Chrome Extension Content Script Re-injection After Upgrade Or Install
Answer : There's a way to allow a content script heavy extension to continue functioning after an upgrade, and to make it work immediately upon installation. Install The install method is to simply iterate through all tabs in all windows, and inject some scripts programmatically into tabs with matching URLs. Obviously, you have to do it in a background page or event page script declared in manifest.json: "background": { "scripts": ["background.js"] }, background.js: // Add a `manifest` property to the `chrome` object. chrome.manifest = chrome.app.getDetails(); var injectIntoTab = function (tab) { // You could iterate through the content scripts here var scripts = chrome.manifest.content_scripts[0].js; var i = 0, s = scripts.length; for( ; i < s; i++ ) { chrome.tabs.executeScript(tab.id, { file: scripts[i] }); } } // Get all windows chrome.windows.getAll({ populate: true }, func...