groovecoder
groovecoder

Reputation: 1581

How do I view & debug contentScriptFile sources in Firefox debugger?

I'm making an add-on with a simple content script using tab.attach and 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);

I have devtools.chrome.enabled = true and devtools.debugger.remote-enabled = true so I can use the Add-on Debugger.

But, when I open the Add-on Debugger, I don't see my doiuse-script.js source?

Upvotes: 0

Views: 59

Answers (1)

groovecoder
groovecoder

Reputation: 1581

I answered my own question while asking it.

As mentioned in the Add-on Debugger docs about content scripts, the Add-on Debugger does not show content script sources unless/until they are loaded. So, the Add-on Debugger won't show the content script source until you reload the page on which the content script activates.

Upvotes: 1

Related Questions