firefox-addon
  • firefox-addon-sdk
  • firefox-developer-tools
  • 2015-12-17 88 views 0 likes 
    0

    我使用tab.attachcontentScriptFile使an add-on用一個簡單的內容腳本:如何在Firefox調試器中查看和調試contentScriptFile源代碼?

    index.js

    tab.attach({ 
        contentScriptFile: "./doiuse-script.js" 
    }); 
    

    data/doiuse-script.js

    if (document.body) document.body.style.border = '5px solid red'; 
    console.log("document.styleSheets: " + document.styleSheets); 
    

    我有devtools.chrome.enabled = truedevtools.debugger.remote-enabled = true這樣我就可以使用Add-on Debugger

    但是,當我打開附加調試器時,我沒有看到我的doiuse-script.js源?

    回答

    1

    我在回答問題時回答了我自己的問題。

    the Add-on Debugger docs about content scripts所述,附加調試器不會顯示內容腳本源,除非/直到它們被加載。因此,除非您重新加載內容腳本激活的頁面,否則附加調試器不會顯示內容腳本源。

    相關問題