Firefox addon won't load jquery as content script on when running Windows

I've created an add-on that loads jQuery as a content script. This is to ensure that other content scripts that rely on jQuery can make use of it.

When running on OSX the extension works as expected and jQuery is loaded in when the extension is started. However the same app running on Windows doesn't load jQuery in. I'm using Firefox version 40 on both machines and I've tried a both the 2.0 and 1.x version of jQuery in the extension to make sure that it's not to do with that.

Has anyone any thoughts on what could be causing the issue?

main.js

tabs.on('ready', function(tab) {
  if(tab.url.indexOf(pageurl) === -1) return;
  worker = tab.attach({ 

  contentScriptFile: [   
  data.url("./app/scripts/jquery.js"),  
  data.url("./app/scripts/google.js")]
  });
  worker.port.on("request-cookie", function(){
      console.log("index.js received cookie request");
      worker.port.emit("response-cookie", getBungieCookies());
    });
});

console error

$ jpm run
JPM [info] Starting jpm run on My Jetpack Addon
JPM [warning] Using existing install.rdf. This file is usually auto-generated.
JPM [warning] Using existing bootstrap.js. This file is usually auto-generated.
Creating XPI
JPM [info] XPI created at C:UserssomalleyAppDataLocalTemp@testaddon-0.0.1.xpi (31090ms)
Created XPI at C:UserssomalleyAppDataLocalTemp@testaddon-0.0.1.xpi
JPM [info] Creating a new profile
console.error: testaddon:
Object
    - _errorType = ReferenceError
    - message = jQuery is not defined
    - fileName = resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/loader/sandbox.js -> resource://testaddon/data/ap
p/scripts/ScrollToFixed.js
    - lineNumber = 558
    - stack = @resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/loader/sandbox.js -> resource://testaddon/data/app/
scripts/ScrollToFixed.js:558:1|
    - name = ReferenceError
console.error: testaddon:
Object
    - _errorType = ReferenceError
    - message = $ is not defined
    - fileName = resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/loader/sandbox.js -> resource://testaddon/data/ap
p/scripts/dimApp.config.js
    - lineNumber = 136
    - stack = @resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/loader/sandbox.js -> resource://testaddon/data/app/
scripts/dimApp.config.js:136:1|
    - name = ReferenceError
console.error: testaddon:
Object
    - _errorType = TypeError
    - message = s is undefined
    - fileName = resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/loader/sandbox.js -> resource://testaddon/data/ap
p/scripts/google.js
    - lineNumber = 8
    - stack = @resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/loader/sandbox.js -> resource://testaddon/data/app/
scripts/google.js:8:55|@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/loader/sandbox.js -> resource://testaddon/
data/app/scripts/google.js:5:2|
    - name = TypeError
链接地址: http://www.djcxy.com/p/45756.html

上一篇: 如何检查iOS版本?

下一篇: Firefox插件在运行Windows时不会将jquery作为内容脚本加载