Firefox扩展覆盖注入JavaScript文件?

Firefox扩展覆盖注入JavaScript文件?,javascript,firefox,firefox-addon,Javascript,Firefox,Firefox Addon,当将一个JavaScript文件注入另一个覆盖在.xul文件上的JavaScript文件时,我得到的消息是“Filtered chrome URL”,而不是加载JavaScript文件 代码: 可以尝试var myScript=doc.createElements('http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul“,”脚本“?仅供参考:JavaScript是一个单词。你能在你的一般解释中显示出有问题的代码吗? var m

当将一个JavaScript文件注入另一个覆盖在.xul文件上的JavaScript文件时,我得到的消息是“Filtered chrome URL”,而不是加载JavaScript文件

代码:


可以尝试
var myScript=doc.createElements('http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul“,”脚本“

仅供参考:JavaScript是一个单词。你能在你的一般解释中显示出有问题的代码吗?
var myScript = doc.createElement('script');
myScript.type = 'text/javascript';
myScript.setAttribute('src', 'chrome://content/MyScript.js');
myScript.setAttribute('onload', 'doThing();');
doc.getElementsByTagName('head')[0].appendChild(myScript);