Firefox插件中的JQuery会导致多个警告 [英] JQuery in Firefox Addon causes multiple warnings

查看:156
本文介绍了Firefox插件中的JQuery会导致多个警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 匿名函数

我在firefox插件中使用了jquery,但是我不断收到如下所示的警告消息:并不总是返回一个值
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 - > ;资源:// GRE /模块/ CommonJS的/工具/加载器。
js - > resource://gre/modules/commonjs/sdk/loader/sandbox.js - >资源:// jid1-i
3fwz29rous8ua-jet-pack / addon-name-removed / data / jquery.js:2435

您能否让我知道我该如何忽略这些错误?我无法找到我的控制台日志或错误,因为他们...

jquery是这样的:

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

感谢!

解决方案

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



看起来<默认情况下,此SDK会打开此首选项(在普通浏览器中默认是关闭的)。似乎没有办法通过命令行切换来改变,所以你不得不在本地修补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.

这篇关于Firefox插件中的JQuery会导致多个警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆