MozillaZine

Dev : Tips : Disable XUL cache

From MozillaZine Knowledge Base

(Difference between revisions)
Revision as of 06:43, 11 October 2004
Zopepaul (Talk | contribs)

<-- Previous diff
Revision as of 01:15, 13 November 2004
Asqueella (Talk | contribs)
(markup+wording)
Next diff -->
Line 1: Line 1:
==nglayout.debug.disable_xul_cache== ==nglayout.debug.disable_xul_cache==
-<tt>nglayout.debug.disable_xul_cache</tt> is a Mozilla [[Firefox : FAQs : Edit Config|preference]] useful for extension developers. Basically when it is set to ''false'' (default), Mozilla caches chrome XUL and JavaScript (and more) in a file named XUL.mfl or similarly. Therefore, when making changes to your extension, you have to restart Mozilla in order to get new version used. As it is very inconvenient, many extension developers set this pref to ''true''.+'''nglayout.debug.disable_xul_cache''' is a Mozilla [[Editing configuration|preference]] useful for extension developers. Basically when it is set to '''false''' (which is default), Mozilla caches chrome XUL and JavaScript (and more) in a file named XUL.mfl or similarly. Therefore, when making changes to your extension, you have to restart Mozilla in order to get new version used. As it is very inconvenient, many extension developers set this pref to '''true'''.
-However even when <tt>nglayout.debug.disable_xul_cache</tt> is set to ''false'', Mozilla forbids rewriting *.jar files that contain installed extensions. To overcome this, and to avoid having to repack every change you make, you can unpack the JAR file you want to edit and make it permanent by updating chrome.rdf to point to the unpacked files instead of the JAR:+However even when '''nglayout.debug.disable_xul_cache''' is set to '''false''', Mozilla forbids rewriting *.jar files that contain installed extensions. To overcome this, and to avoid having to repack every change you make, you can unpack the JAR file you want to edit and make it permanent by updating chrome.rdf to point to the unpacked files instead of the JAR:
===Using chrome.rdf=== ===Using chrome.rdf===

Revision as of 01:15, 13 November 2004

Contents

nglayout.debug.disable_xul_cache

nglayout.debug.disable_xul_cache is a Mozilla preference useful for extension developers. Basically when it is set to false (which is default), Mozilla caches chrome XUL and JavaScript (and more) in a file named XUL.mfl or similarly. Therefore, when making changes to your extension, you have to restart Mozilla in order to get new version used. As it is very inconvenient, many extension developers set this pref to true.

However even when nglayout.debug.disable_xul_cache is set to false, Mozilla forbids rewriting *.jar files that contain installed extensions. To overcome this, and to avoid having to repack every change you make, you can unpack the JAR file you want to edit and make it permanent by updating chrome.rdf to point to the unpacked files instead of the JAR:

Using chrome.rdf

We assume that the extension is installed in profile in this section. For global installation see next section.

Important!! Backup your profile before editing chrome.rdf!

  1. Unpack the JAR file you have, say Profiles\default\extensions\{YOUR-EXTENSION'S-GUID}\my-ext.jar to the same directory. You will get (at least) Profiles\default\extensions\{YOUR-EXTENSION'S-GUID}\content directory.
  2. In Profiles\default\chrome\chrome.rdf look for my-ext.jar! and delete it. For example replace this line
    c:baseURL="jar:file:///D:/Firefox/Profiles/default/extensions/{GUID}/chrome/my-ext.jar!/content/my-ext/"

    with this:

    c:baseURL="file:///D:/Firefox/Profiles/default/extensions/{GUID}/chrome/content/my-ext/"
    Note, that you should also delete jar: at the beginning of the path.

Changing install.rdf

Perhaps you would like to package your extension as a series of directories, rather than a jar file. This would allow, for example, an XPI that could be easily edited and perhaps checked back into a repository (e.g. a developer version).

Change the install.rdf from:

<Description about="urn:mozilla:extension:file:myextension.jar">

to:

<Description about="urn:mozilla:extension:file:myextension">

An example of this technique is available. Also, myk is planning to update his tinderstatus extension to demonstrate this technique.

Using installed-chrome.txt

Write me!