I needed to write a unit test for
bug 304188, and I didn't have any experience with that.
Unit tests expect to have chrome privileges. Normally I use enablePrivilege to get enhanced privileges, but for various reasons my test wasn't working correctly. So that's why I wanted to be able to use a chrome:// url to have enhanced privileges 'automatically'.
Normally, I rip an extension apart and put the file in question in the content directory of the extension, but this time I wanted an easier way.
According to this
xulplanet, I could add a chrome.manifest file to my profile's chrome/ directory.
My profile directory is: C:\Documents and Settings\mw\Application Data\Mozilla\Firefox\Profiles\uulmz982.Default User
So I thought that adding the chrome.manifest file to C:\Documents and Settings\mw\Application Data\Mozilla\Firefox\Profiles\uulmz982.Default User\chrome would work. Apparently, that doesn't work and isn't supposed to work, so I heard.
My chrome.manifest file consists of this:
content tests file:///C:/testfiles/
So that means I can put content in C:/testfiles/ and can access them with chrome privileges from a certain chrome:// url.
Thanks to
Mossop on #extdev, I heard what the 'correct' way is of doing this.
I did the following (finally, after a lot of tries)
- Create a folder named test@test at C:\Documents and Settings\mw\Application Data\Mozilla\Firefox\Profiles\uulmz982.Default User\extensions
- Create 2 files:
Note, you should now also see the Test Extension in Tools->Add-ons. So basically, I've made a (very simple) extension by doing this.