【问题标题】:How do I view & debug contentScriptFile sources in Firefox debugger?如何在 Firefox 调试器中查看和调试 contentScriptFile 源?
【发布时间】:2015-12-17 13:03:36
【问题描述】:

我正在使用tab.attachcontentScriptFile 使用简单的内容脚本制作an add-on

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 源代码?

【问题讨论】:

    标签: firefox-addon firefox-addon-sdk firefox-developer-tools


    【解决方案1】:

    我在提问时回答了自己的问题。

    the Add-on Debugger docs about content scripts 中所述,加载项调试器不会显示内容脚本源,除非/直到它们被加载。因此,在您重新加载激活内容脚本的页面之前,加载项调试器不会显示内容脚本源。

    【讨论】:

      猜你喜欢
      • 2011-11-26
      • 1970-01-01
      • 2010-10-28
      • 2018-11-16
      • 1970-01-01
      • 1970-01-01
      • 2023-04-01
      • 1970-01-01
      • 2014-02-21
      相关资源
      最近更新 更多