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

400 Views Asked by At

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

2

There are 2 best solutions below

0
Haibrayn González On BEST ANSWER

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.

3
Smile4ever On

You can use the developer tools for debugging content scripts. They are not visible in the "debugging UI" which is accessible by the debug button on about:debugging.

If you don't see the content scripts or your addon in the normal developer tools, reload the current tab.