Chrome Extension source scripts not loading

My chrome background extension script does not load. I followed him, but still nothing. I'm not sure if there is another way to check, but this is not in the Inspect Element, and what the script does not happen.

http://developer.chrome.com/extensions/background_pages.html

manifest.json file

{ "manifest_version": 2, "name": "WebDevFriend", "description": "blah blah blah", "version": "1.0", "permissions": [ "bookmarks", "tabs", "http://*/*" ], "background": { "scripts": ["js/settings.js"], }, "browser_action": { "default_icon": "images/icon.png", "default_popup": "html/popup.html" } } 

settings.js file

 chrome.windows.onCreated.addListener(function(window){ chrome.windows.getAll(function(windows){ var length = windows.length; if (length == 2) { chrome.tabs.executeScript(null, {file: "content_script.js"}); } }); }); document.write('hello'); 
+4
source share
1 answer

At first, you cannot view the background page like a regular html page. The only way is to view its contents using the Chrome Developer Tools.

enter image description here

just click generated_background_page.html in the extensions section of your browser.

The latter use the console.log() operator for log messages.

+4
source

All Articles