[Jslib] Getting location of extension jarfile in Mozilla and Firefox

Sudhakar Chandra thaths at openscroll.org
Wed Oct 6 18:46:18 EDT 2004


Pete Collins wrote:
> Does DirUtils.getMozUserHomeDir() get you to - 
> "~/.mozilla/firefox/iztq6gmd.default/"  ??

On Firefox, yes.  Since I know the unique ID of my extension, I think I 
can append that to getMozUserHomeDir() and get the full path.

On Mozilla it throws the following error:

-----======[ jsLib ERROR ]=====-----
FileName:          chrome://habarixenu/content/io/file.js
Result:            2147500037
Message:           Component returned failure code: 0x80004005 
(NS_ERROR_FAILURE
) [nsILocalFile.create]
LineNumber:        610
-------------------------------------

NS_ERROR_FILE_NOT_FOUND
****** [xpconnect wrapped nsIURI]

-----======[ jsLib ERROR ]=====-----
FileName:          chrome://habarixenu/content/io/file.js
Result:            2152857618
Message:           Component returned failure code: 0x80520012 
(NS_ERROR_FILE_NO
T_FOUND) [nsIChannel.open]
LineNumber:        321
-------------------------------------


-----======[ jsLib ERROR ]=====-----
FileName:          chrome://habarixenu/content/io/file.js
Result:            2152857606
Message:           Component returned failure code: 0x80520006 
(NS_ERROR_FILE_TA
RGET_DOES_NOT_EXIST) [nsILocalFile.fileSize]
LineNumber:        368
-------------------------------------

So I guess I need to work around this with some browser sniffing.

BTW, I'm using version 0.1.185 of JSLIb.  Will file a bug.

Thanks.

Thaths
-- 
Grandpa: "I'm an old man, no one listens to me."
Lisa:    "I'm a young girl, no one listens to me."
Homer:   "I'm a white male aged 18 to 49, everyone listens to me, no
          matter how dumb my suggestions are."
Slacker Without Borders                        http://openscroll.org/
Key fingerprint = 8A 84 2E 67 10 9A 64 03  24 38 B6 AB 1B 6E 8C E4


More information about the Jslib mailing list