Debugging Content Scripts for Chrome Extension

后端 未结 2 1480
忘掉有多难
忘掉有多难 2020-12-05 12:53

General Questions

Hello! I\'m delving into the world of Chrome Extensions and am having some problems getting the overall workflow down. It seems that Google has r

2条回答
  •  盖世英雄少女心
    2020-12-05 13:16

    Content scripts' console.log messages are shown in the web page's console instead of the background page's inspector.

    Adding debugger; works if the Developer Tool (for the web page where your content script is injected) is opened.

    Therefore, in this case, you should first activate the Developer Tool (of the web page) before clicking the browser action icon and everything should work just fine.

提交回复
热议问题