google chrome extension - Why isn't my background script getting executed? -


i added simple background script chrome extension.

my manifest.json file:

{   "name" : "test extension",   "version" : "1.0",   "description" : "test extension.",   "background" : {     "scripts": ["background.js"]   },   "devtools_page": "devtools.html",   "permissions": ["http://*/*", "https://*/*"],   "manifest_version": 2 } 

i go chrome://extensions , select background.js in inspect views.

it opens devtools go sources , add break point background.js:

function foo() {     return 5; } foo(); //break point here 

then reload extension in chrome://extensions. nothing happens. breakpoint not triggered. background script running @ all?

simple answer... struggled while too...

once click background.html (or background.js), open in separate debugger window. @ point, reload hitting f5 or ctrl-f5 key(s) debugger window (while in focus).

note: may receive errors recreating objects exist (since created when first clicked on page(or script)


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -