Getting started with extension development - MozillaZine Know...
Popularity Report
![]() |
|||
![]() |
|||
![]() |
|||
![]() |
|||
![]() |
|||
![]() |
URL Tag Cloud
Bookmark History
Public Sticky notes
Highlighted by ktenney
Highlighted by monabili
Highlighted by monabili
Highlighted by monabili
Highlighted by pedersenryan
Highlighted by monabili
Highlighted by mayabelle
Highlighted by monabili
Highlighted by monabili
Highlighted by monabili
Highlighted by monabili
Create the following structure in the folder where you intend to develop your project:
helloworld/
chrome.manifest
install.rdf
content/
overlay.js
overlay.xul
hello.xul
locale/
en-US/
overlay.dtd
hello.dtd
skin/
overlay.css
The folders are traditionally named "content", "locale" and "skin", and you should follow the tradition. You may call the files inside those folders whatever you want (except chrome.manifest and install.rdf).
Highlighted by mayabelle
1 |
content helloworld content/ |
|---|
What each line of the file does:
- Line 1 registers a content provider: it maps the contents of
chrome://helloworld/content/to the content folder. - Line 2 registers an overlay for
chrome://browser/content/browser.xullocation, allowing you to modify Firefox's main window UI from your overlay.xul file. - Line 4 registers a en-US locale provider.
- Line 6 registers a default skin provider.
- Line 7 applies your overlay.css style file to
chrome://global/content/customizeToolbar.xuldocument (used, for example, when creating toolbar buttons). You could instead register an overlay and include the stylesheet in the overlay using the<?xml-stylesheet?>processing instruction.
Highlighted by mayabelle
Highlighted by mayabelle
Highlighted by mayabelle
Highlighted by mayabelle
Highlighted by mayabelle
Highlighted by mayabelle
Highlighted by mayabelle
Highlighted by mayabelle
DTD files are used to make XUL/XBL/XHTML and other XML files in Mozilla chrome localizable. Basically, instead of hard-coding the strings in your XUL file, you use XML entities, which expand to the values declared in the DTD file referenced at the top of the XUL file.
It makes your extension localizable, because there may be a few different locale providers for your extension, and Mozilla is able to choose between them at run-time.
Highlighted by mayabelle
Highlighted by mayabelle
Highlighted by mayabelle
Highlighted by vinaykr
Highlighted by mayabelle
Highlighted by mayabelle
Highlighted by mayabelle
Highlighted by mayabelle
Highlighted by mayabelle
profile folder/extensions/ and edit it so that it contains the path to your folder containing install.rdf and chrome.manifest files.
Highlighted by mayabelle
Highlighted by monabili
Highlighted by mayabelle
Highlighted by mayabelle


Public Comment
on 2006-07-31 by ziller