且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Firefox插件中的JQuery会导致多个警告

更新时间:2022-10-26 20:53:42

这些警告是 javascript.options.strict (可以在about:config中关闭并再次打开)。不幸的是,据我所知,这些警告不能在逐个文件(或URI-by-URI)的基础上关闭。



看起来此首选项(在普通浏览器中默认是关闭的)。似乎没有办法通过命令行切换来改变,所以你不得不在本地修补SDK副本中的链接文件。



这些是有效的警告,但正如你所指出的,当谈到你无法修复的第三方库代码时,这是毫无用处的。


I'm using jquery within a firefox addon, but i keep getting tons of warning messages like below:

                     anonymous function does not always return a value
System JS : WARNING resource://gre/modules/XPIProvider.jsm -> jar:file:///c:/use
rs/usernameremoved/appdata/local/temp/tmprpnucw.mozrunner/extensions/jid1-I3FWz29roUS
8UA@jetpack.xpi!/bootstrap.js -> resource://gre/modules/commonjs/toolkit/loader.
js -> resource://gre/modules/commonjs/sdk/loader/sandbox.js -> resource://jid1-i
3fwz29rous8ua-at-jetpack/addon-name-removed/data/jquery.js:2435

Can you please let me know how can i ignore these errors? I can't find my console logs or errors because of them...

Jquery is included like this:

contentScriptFile: [self.data.url("jquery.js"),
self.data.url("zde.js"),
self.data.url("zdf.js")],
contentStyleFile: self.data.url("zd.css"),

Thanks!

These warnings are a result of the javascript.options.strict (can be turned off and on again in about:config). Unfortunately, as far as I know, these warnings cannot be turned off on a file-by-file (or URI-by-URI) basis.

It appears that the SDK turns on this preference by default (in a normal browser it is turned off by default). There doesn't seem to be a way to change that via command line switches, so you'd have to locally patch the linked file in your copy of the SDK.

Those are valid warnings, but as you noted, pretty useless when it comes to third-party library code that you cannot fix anyway.