Overlays: Difference between revisions

From MozillaZine Knowledge Base
Jump to navigationJump to search
No edit summary
(redirect to devmo)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{extdev}}
See [http://developer.mozilla.org/en/docs/XUL_Overlays XUL Overlays] and [http://developer.mozilla.org/en/docs/XUL_Tutorial:Cross_Package_Overlays XUL Tutorial: Cross Package Overlays] at [http://developer.mozilla.org MDC].


 
[[Category:Redirects]]
See http://developer.mozilla.org/en/docs/XUL_Overlays for general information about overlays.
 
__NOTOC__
= Registering overlays =
== Firefox 1.5 and newer ==
In Firefox 1.5 and Thunderbird 1.5, contents.rdf and RDF-based overlayinfo directory were dropped in favor of plain-text chrome.manifest files. Chrome manifests are automatically generated from contents.rdf for legacy extensions. See http://developer.mozilla.org/en/docs/Chrome_Registration for more information.
 
The information below is only useful for pre-Gecko 1.8 applications.
 
 
== Firefox 1.0 / Mozilla Suite ==
 
===Specifying overlays when developing extensions===
Information about overlays should be specified in a contents.rdf file inside the same folder as your overlays. For example, if you have an overlay in content/myextension/myOverlay.xul in myextension.jar which overlays the chrome://browser/content/browser.xul location (<install directory>/chrome/browser.jar/browser/content/browser/browser.xul file), you should include the following two things in content/myextension/contents.rdf:
 
<ol>
<li>Add the line
<pre><RDF:li RDF:resource="chrome://browser/content/browser.xul"/></pre>
inside the tag
<pre><RDF:Seq RDF:about="urn:mozilla:overlays">
</RDF:Seq></pre>
(Create this tag if it doesn't already exist.)
</li>
 
<li>Further down, add the tag
<pre><RDF:Seq RDF:about="chrome://browser/content/browser.xul">
<RDF:li>chrome://myextension/content/myOverlay.xul</RDF:li>
</RDF:Seq></pre>
</li>
</ol>
 
It is usually quite easy to find the chrome URL of the window you want to overlay. For your convenience, the URLs of some windows are listed in [[Chrome URLs]]. If you don't see the window you need to overlay listed, get [[DOM Inspector]], open the window and click File > Inspect a Window > your window. The chrome URL will be displayed in the top textbox.
 
See also [[Contents.rdf]].
 
===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
<pre>
<RDF:Seq RDF:about="chrome://mozapps/content/downloads/unknownContentType.xul">
<RDF:li>chrome://myextension/content/myOverlay.xul</RDF:li>
</RDF:Seq>
</pre>
then this information is copied into <profile>/chrome/overlayinfo/mozapps/content/overlays.rdf.
 
Once an extension is installed, Mozilla pays no further heed to the contents.rdf files and refers instead to the overlays.rdf files.
 
{{msg:stub}}
 
[[Category:Development]]

Latest revision as of 19:16, 23 May 2007