MozillaZine

Overlays

From MozillaZine Knowledge Base

(Difference between revisions)
Revision as of 14:23, 12 September 2004
Asqueella (Talk | contribs)
(Profile Folder)
<-- Previous diff
Revision as of 16:55, 13 September 2004
Mozcerize (Talk | contribs)
(Just correcting typos)
Next diff -->
Line 4: Line 4:
===Specifying overlays when packaging extensions=== ===Specifying overlays when packaging extensions===
-Information about overlays should be specified in a contents.rdf file inside the same folder as any XUL overlay. For example, if you have a file contents/myextension/myOverlay.xul in myextension.jar which overlays the file content/mozapps/downloads/unknownContentType.xul in <mozilla install directory>/chrome/toolkit.jar then you should include two things in myextension.jar/contents/myextension/contents.rdf.+Information about overlays should be specified in a contents.rdf file inside the same folder as any XUL overlay. For example, if you have a file contents/myextension/myOverlay.xul in myextension.jar which overlays the file content/mozapps/downloads/unknownContentType.xul in <mozilla install directory>/chrome/toolkit.jar then you should include the following two things in myextension.jar/contents/myextension/contents.rdf.
Add the line Add the line
Line 11: Line 11:
<RDF:Seq RDF:about="urn:mozilla:overlays"> <RDF:Seq RDF:about="urn:mozilla:overlays">
</RDF:Seq> </RDF:Seq>
-or create this tag if it doesn't already exist;+(Create this tag if it doesn't already exist.)
Further down, add the tag Further down, add the tag
Line 19: Line 19:
===Where Mozilla stores extension overlay information=== ===Where Mozilla stores extension overlay information===
-When an extension is installed, overlay information found in its various contents.rdf files is copied into various overlays.rdf files located inside the [[Profile Folder]] under chrome\overlayinfo. For example, if a contents.rdf file contains+When an extension is installed, overlay information found in its various contents.rdf files is copied into various overlays.rdf files located inside the [[Profile Folder]] under chrome/overlayinfo. For example, if a contents.rdf file contains
<RDF:Seq RDF:about="chrome://mozapps/content/downloads/unknownContentType.xul"> <RDF:Seq RDF:about="chrome://mozapps/content/downloads/unknownContentType.xul">
Line 28: Line 28:
<RDF:li>chrome://myextension/content/myOverlay.xul</RDF:li> <RDF:li>chrome://myextension/content/myOverlay.xul</RDF:li>
</RDF:Seq> </RDF:Seq>
-in an overlays.rdf file created in the folder <profile>\chrome\overlayinfo\mozapps\content.+in an overlays.rdf file created in the folder <profile>/chrome/overlayinfo/mozapps/content.
Once an extension is installed, Mozilla pays no further heed to the contents.rdf files and refers instead to the overlays.rdf files. Once an extension is installed, Mozilla pays no further heed to the contents.rdf files and refers instead to the overlays.rdf files.

Revision as of 16:55, 13 September 2004

Much of the information intended for this page is not written yet. Take a look at http://xulplanet.com/tutorials/xulapp/overlays.html

Registering overlay information for extensions

Specifying overlays when packaging extensions

Information about overlays should be specified in a contents.rdf file inside the same folder as any XUL overlay. For example, if you have a file contents/myextension/myOverlay.xul in myextension.jar which overlays the file content/mozapps/downloads/unknownContentType.xul in <mozilla install directory>/chrome/toolkit.jar then you should include the following two things in myextension.jar/contents/myextension/contents.rdf.

Add the line

   <RDF:li RDF:resource="chrome://mozapps/content/downloads/unknownContentType.xul"/>

inside the tag

 <RDF:Seq RDF:about="urn:mozilla:overlays">
 </RDF:Seq>

(Create this tag if it doesn't already exist.)

Further down, add the tag

 <RDF:Seq RDF:about="chrome://mozapps/content/downloads/unknownContentType.xul">
   <RDF:li>chrome://myextension/content/myOverlay.xul</RDF:li>
 </RDF:Seq>

Where Mozilla stores extension overlay information

When an extension is installed, overlay information found in its various contents.rdf files is copied into various overlays.rdf files located inside the Profile Folder under chrome/overlayinfo. For example, if a contents.rdf file contains

 <RDF:Seq RDF:about="chrome://mozapps/content/downloads/unknownContentType.xul">
   <RDF:li>chrome://myextension/content/myOverlay.xul</RDF:li>
 </RDF:Seq>

then this information becomes

 <RDF:Seq RDF:about="chrome://mozapps/content/downloads/unknownContentType.xul">
   <RDF:li>chrome://myextension/content/myOverlay.xul</RDF:li>
 </RDF:Seq>

in an overlays.rdf file created in the folder <profile>/chrome/overlayinfo/mozapps/content.

Once an extension is installed, Mozilla pays no further heed to the contents.rdf files and refers instead to the overlays.rdf files.