Debugging Content Scripts for Chrome Extension

后端 未结 2 1479
忘掉有多难
忘掉有多难 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:20

    I tried to use the debuggermethod, but it doesn't not work well because the project is using require.js to bundle javascript files.

    If you are also using require.js for chrome extension development, you can try adding something like this to the code base, AND change eval(xhr.responseText) to eval(xhr.responseText + "\n//@ sourceURL=" + url);. (like this question)

    Then you can see the source file in your dev tool (but not the background html window)

提交回复
热议问题