Debugging content.js

sfcheng at sfcheng at
Thu Sep 20 14:50:39 UTC 2018

Thanks a lot for your help. Thank works perfectly. 

Rest Regards,
Shanfeng Cheng
sfcheng at
From: Matthew N.
Date: 2018-09-20 01:37
To: sfcheng at
CC: firefox-dev
Subject: Re: Debugging content.js

The Browser Content Toolbox is technically per-content-process, not per-tab. From the Browser Content Toolbox you can enumerate the tabs with the `tabs` variable. (e.g. `tabs[0].content`).

I haven't tested this but I believe if you set the pref "dom.ipc.processCount" = 1 in about:config and restart Firefox then that will force one content process to be used so a single Browser Content Toolbox window should be able to hit breakpoints for all tabs.

Let us know if that doesn't work.
Matthew N. (:MattN)

On Wed, Sep 19, 2018 at 7:55 AM, sfcheng at <sfcheng at> wrote:

I am still trying to find my way around the source code. It looks like the code inside base\content\content.js is executed for each individual tab. The browser content toolbox is meant to debug such code. However, one browser content toolbox is associated with each individual tab. I can only open the toolbox after the tab is opened. Therefore, I am not able to debug the initialization code inside content.js since it's already run after the tab is opened. Any idea how to work around this?

Rest Regards,
Shanfeng Cheng
sfcheng at

firefox-dev mailing list
firefox-dev at

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the firefox-dev mailing list