Open Firefox network before page is opened

2019-08-26 05:36发布

问题:

I'm using Firefox and want to analyses the request/response of a page.

Is there a way to open the Developer tools (firefox-developer-tools) - namely "Network" - before entering/opening the page (Automatic opening second tab).

Otherwise it would not be possible to track the traffic correct.

回答1:

As far as I know there is no option/config for doing that (as of v65), but you can do that with --devtools flag (https://bugzilla.mozilla.org/show_bug.cgi?id=1226744), sadly there is some limitations:

  1. If you have running Firefox, you should close it or use another profile (--no-remote -p profilename)
  2. Firefox will open dev tools on startup only for first tab and not for all other new tabs.

So, assume you have another profile (let's call it dev), follow this steps:

  1. Head to Firefox install location
  2. Open up your favorite command-line
  3. Use this command: firefox.exe --devtools --no-remote -p dev --url YOUR_SITE_URL

If you don't have/like another profile, you have to close Firefox first

P.S: Reorder devtools tabs is dead easy, you can do that using drag/drop.

Update

Based on your comment, I think all you need is Persist Logs option,

  • Hit F12
  • Select Network tab
  • On first row (toolbar) you should see Persist Logs option, just select that

Now refresh the page, you will logs doesn't deleted anymore.

P.S: Persist Logs is available for Console tab too.