Reputation: 90
Hi I am building a Mozilla Extension through CFX tool. I have used ChromeWorker in it. It is working fine while i am running : cfx run command. But while building up a package using cfx xpi the Chrome Worker file is not included in the xpi package. I am using this to create the worker thread. var tworker = new ChromeWorker("chrome://addons/content/t_worker.js");
my t_worker.js file is present in addons/lib
I have also put one chrome.manifest file in the package that contains : content addons ./resources/addons/lib/
Please tell the possible reason for this problem and also how to fix it .
Upvotes: 1
Views: 36
Reputation: 90
I putted that worker file in the lib thats why its not working. I just changed the location of my file to data folder and made changes in my chrome.manifest file : content addons ./resources/addons/data(previously it was lib)/ . Its working fine Thanks to @Noitidart for the suggestion of putting it in data folder
Upvotes: 0
Reputation: 37288
Try moving your file into the data folder then do:
const self = require('sdk/self');
var tworker = new ChromeWorker(self.data.url('t_worker.js')
im totally not sure of this syntax, i just typed off top of my head
Upvotes: 1