Unable to view content script references in the developer tools window

回眸只為那壹抹淺笑 提交于 2019-12-05 09:08:30
Brock Adams

As long as you are on a page that matches the "Match patterns and globs" from your manifest, you will see the content script(s) under the Sources -> Content Scripts pane.
You may need to refresh (F5) the page (and/or your extension, then the page) to see it:

(Click for larger image)


For more information on matching that cryptic number to an extension, see this answer.

content scripts as a js file are never exposed by pages which are injected.. If your intention is debugging of content scripts it can be possible;

Ex:

mycontentscripts.js

var getStyleofbody = document.getElementsByTagName('body')[0].style;

to debug this i would first run this code in console of page that i am going to inject; After i get expected results i will move code to contentscript js file.

However for any errors after injection you can look at developer's console panel for all errors(they are listed there).

Let me know if you are confused

In 2018, if for some reason you've missed it:

Press the >>. From there select content scripts, and you'll be able to see the content scripts.

hf :)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!