JPM undefined

I have the following exception under Firefox 40.0.3 / MacOS X.10 and jpm 1.0.0:

JPM undefined *************************
A coding exception was thrown and uncaught in a Task.

Full message: TypeError: tab is null
Full stack: Toolbox.prototype.selectTool@resource://gre/modules/commonjs/toolkit/loader.js -> resource:///modules/devtools/framework/toolbox.js:1131:5
Toolbox.prototype.open/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource:///modules/devtools/framework/toolbox.js:373:13
TaskImpl_run@resource://gre/modules/Task.jsm:314:40
Handler.prototype.process@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:867:23
this.PromiseWalker.walkerLoop@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:746:7
this.PromiseWalker.scheduleWalkerLoop/<@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:688:37

The code which is suppose to generate this exception below.
The URL, and this may be the exception reason is a resource://<>/data/html/options.html

verifrom.tabs.open({
url: optionsPageURL,
inNewWindow:false,
inBackground:false,
isPinned:false,
onReady:function(OptionsTab)
{
console.log(‘Options Tab is ready’, OptionsTab);
var optionsWorker=OptionsTab.attach({
contentScriptFile:[
data.url(‘js/jquery1.7.2.min.js’),
data.url(‘js/options.js’)
]
});
}
onClose: function(OptionsTab)
{
blah blah blah
}
});

Any idea how to fix that? Or is it impossible to attach a content script to a page loaded from add-on resources?

Thanks

I would need to see more of the code, for example, is verifrom.tabs.open set correctly. I have a feeling it may not be. Also, can you use code formatting on here to make it easier to read?

Hi Arenlor,

verifrom.tabs.open is defined in a JS component (used for cross-browsers extension dev) and works really fine in all other cases.

tabs : {
		open:function(options) {
		var tabsAPI=require("sdk/tabs");
			if (typeof options !== 'string')
				tabsAPI.open({url:options.url});
			else tabsAPI.open(options);
		}
	}

Anyway, I didn’t succeed with this approach. So i used a pageMod to attach a content script. And this works fine.
I’m not sure it’s really different, from my understanding.

Hope this helps.

Emmanuel