Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you debug internal Firefox javascript modules?

Much of Firefox is implemented as javascript modules in javascript in files like: resource://gre/modules/AddonManager.jsm How can you get a javascript debugger to set breakpoints in this code as the Firefox starts up?

(Most Firefox documentation and web searches refer to javascript debugging for the 'end user' web page scripts, not the internal scripts)

like image 351
Ribo Avatar asked Sep 01 '25 20:09

Ribo


1 Answers

On Firefox 19 or later, it's possible to use the built-in JS debugger on the browser itself. Go to about:config and set the following two prefs:

devtools.chrome.enabled: true,

devtools.debugger.remote-enabled: true

After you restart the browser, you can access the Browser Debugger through Tools > Web Developer > Browser Toolbox. (Note that before Firefox 28, this was labeled "Browser Debugger" and only the debugger was available, not the whole toolbox.)

https://developer.mozilla.org/en-US/docs/Mozilla/Debugging/Debugging_JavaScript

like image 92
Daniil Avatar answered Sep 07 '25 15:09

Daniil