Adding background scripts to a firefox add-on -


i want add file(background.js) background script firefox extension. added content scripts main.js using following code.

 var panel = panels.panel({    contenturl: self.data.url("panel.html"),    onhide: handlehide,    contentscriptfile: [self.data.url("js/jquery.js"),                    self.data.url("tipsy/jquery.tipsy.js"),,                   self.data.url("js/settings.js")] }); 

how add background scripts main.js file.

simply place file in lib folder.

except scripts interact directly web content, javascript code you'll write or use when developing add-ons using sdk part of commonjs module.

essentially, backend script don't share variables content scripts/normal js. export , require variables between modules.

see adding local modules


Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -