Debugging content.js

sfcheng at gmail.com sfcheng at gmail.com
Thu Sep 20 14:50:39 UTC 2018


Thanks a lot for your help. Thank works perfectly. 



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

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 gmail.com <sfcheng at gmail.com> wrote:
Hi,

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 gmail.com

_______________________________________________
firefox-dev mailing list
firefox-dev at mozilla.org
https://mail.mozilla.org/listinfo/firefox-dev


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/firefox-dev/attachments/20180920/9cda1a56/attachment.html>


More information about the firefox-dev mailing list