Search code examples
firefox-addonfirefox-addon-webextensionscontent-scriptjavascript-debuggerfirefox-quantum

Can't execute content script functions of an extension in the Firefox Quantum console


I'm developing a WebExtension compatible with chrome and FF, but in firefox I'm not able to see the variables or functions of the content scripts in the console.

In chrome you can change the scope of the console to see what your extension sees.

Is there a workaround in firefox to be able to debug my content scripts and execute browser functions? I can only have access to the background scripts or popup, but I need to access the content scripts context.

Thanks


Solution

  • I found out that the console of the debugging tools switches scopes when you set a breakpoint in the content script, otherwise you can only see the normal page scope and not the content scripts scope, and when you hit a breakpoint, you will see the scope of what the break point sees.

    In chrome you can just switch the scope of the console.