javascript - Chrome Extensions Bloated Background Page -
is there technique break down or modularize background page in chrome extension? go on developing extension of javascript in background page , since it's long lasting running script of extension (the minority of javascript in popup.js , content scripts). wanted know developers - accept big background.js file? ideally "include" different js files containing data or objects , include them background.js not possible in javascript .
any advice ?
instead of specifying background script, can specify own background page, see http://developer.chrome.com/extensions/background_pages.html docs. such background page allows load number of scripts using regular script tags, or other techniques. when specify background script instead of background page, default background page (with 1 script tag pointing script) generated you.
you script loaders requirejs.
i'm developing extension using commonjs modules (i.e. style used in node.js) compiled browserify, combines modules 1 big file. works me.
Comments
Post a Comment