Created
March 29, 2013 23:04
-
-
Save jxpx777/5274270 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var pageModParams = { | |
'include': ["*"], | |
'attachTo': ["top", "existing", "frame"], | |
'contentScriptFile': [ | |
data.url("src/common.js"), | |
data.url("src/end.js") | |
//other scripts to include | |
] | |
}; | |
function attachWorkerToTab(tab){ | |
var worker; | |
if (!tab) tab = tabs.activeTab | |
if (workersForTab(tab).length > 0) return; | |
worker = tab['attach'](pageModParams); | |
//configure worker listener stuff | |
} | |
tabs.on('activate', function(tab) { | |
if (DEBUG_FIREFOX) console.log("[FIREFOX] activating tab " + tab.url); | |
attachWorkerToTab(tab); | |
}); | |
tabs.on('ready', function(tab) { | |
if (DEBUG_FIREFOX) console.log("[FIREFOX] tab ready " + tab.url); | |
attachWorkerToTab(tab); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment