How to debug chrome extension background file
But when you open chrome developers tool to debug your code, you will probably see the “option.js”, “popup.html” files but not the “background.js, like this:
And If you try to access the Sources, you will get something like this:
So my solution to you is by using this URL in your Google chrome browser:
- Click on “Extensions”
- Choose the extension you want to debug.
You can see the debug in the image:
And after clicking on one of the extensions, your chrome developers tool will look like this:
Notice that this issue is not always the case, because sometimes you will find the “background.js” file in just by clicking on F-12 in popup.html view and you will see this :
Thanks for reading this post, if you have other solution to this I will be glad to add it here.