Firefox Extension Development Tutorial
Short Description
JavaScript Tutorials and Reference: http://www.w3schools.com/js/default.asp. A great JavaScript Tutorial for the Total Non-Programmer: …
Website: www.rietta.com | Filesize: 10kb
Content
Firefox Extension Development
Tutorial
Table of contents
1 Overview……………………………………………………………………………………………………………2
2 JavaScript Basics………………………………………………………………………………………………….2
3 Working with the DOM……………………………………………………………………………………….. 3
4 Further Reading……………………………………………………………………………………………………4
Copyright . 2005 LCC 3401 Firefox Group All rights reserved.1. Overview
All of the guts of your extension will be written in JavaScript. If you already know
JavaScript than you are good to go! If you are new to JavaScript it is highly recommended
that you read through the next section and the supporting documentation to get used to the
syntax.
All of your JavaScript code files should go in the content directory of your extension. This is
where the XUL files go as well, so they will be able to easily reference the code. Just insert
the following line in an XUL file that needs to run functions from your files…
src="chrome://hpsched/content/mycode.js" />
Make sure you use the chrome URI so that Firefox can find the file correctly.
2. JavaScript Basics
JavaScript is a fairly straight forward scripting language. Let's jump right into some sample
code:
/*
* Save the Schedules List to the
"extensions.hpsched.schedules" preference.
* This is called by the pref's system when the GUI element is
altered.
*/
function saveSchedulesList() {
var schedulesList =
document.getElementById("schedulesList").childNodes;
var prefString = "";
for (var i=0; i < schedulesList.length;...
Get the file Download here
Related Books:Related Searches: content directory, reading 4, javascript tutorial, xul, s system
Comments
Leave a Reply