Closed Bug 1206649 Opened 9 years ago Closed 9 years ago

enableAutoExportToFile does not work

Categories

(DevTools :: Netmonitor, defect)

41 Branch
x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: dan, Assigned: Honza)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.85 Safari/537.36

Steps to reproduce:

Using version 41 beta 9 on Ubuntu 14.04. Regular (non-root) user.

Set devtools.netmonitor.har.enableAutoExportToFile = true

Visited a a variety of site to test this. Looked in the profile, under har/logs nothing is generated.

Tried setting the log dir using devtools.netmonitor.har.defaultLogDir to a folder I know exists and I have write access to. Still nothing generated.

Tried setting devtools.netmonitor.har.forceExport to true. Still nothing generated.



Actual results:

No HAR file was generated

There is no indication of why it's not working. Nothing is written to stdout about it.


Expected results:

A HAR file should have been generated. 

If there was a reason for it not to work I would expect to see a message in stdout and/or somewhere in the GUI.
Component: Untriaged → Developer Tools: Netmonitor
OS: Unspecified → Linux
Hardware: Unspecified → x86_64
I'm experiencing the exactly same behaviour on Mozilla Firefox 41.0.2 on Arch Linux.
Having the same problem with Firefox 42.0 on Windows 7. Has anyone figured out the problem?
Do you have the (developer) Toolbox opened?

Honza
Hi,

yes 

the har is not generated even with the toolbox opened ( on the network tab ).

only setting I changed is :
devtools.netmonitor.har.enableAutoExportToFile;true

Using FF 42.0 on archlinux.


Regards
Alex
I am testing on Win7 and it works for me and also...

And yes, just like Alex, the only setting I changed is:
devtools.netmonitor.har.enableAutoExportToFile;true

Do you see any errors in the Browser Console (Ctrl+Shift+J)?

What could be different in our configs?

Honza
I opened the (developer) toolbox then loaded the page and it works fine. This fix is actually so simple I feel rather silly now. Thank you Honza!

Perhaps you should include that bit of info. in your instructions for folks like me who don't realise you need it open.

Regards,
When testing with www.20minutes.fr, I get the following error in the console :

HarCollector.onNetworkEventUpdate; ERROR Unknown event actor: networkEventUpdate


with other websites ( www.google.com for ex ), no such error, but no har neither!
By bad, after user a clean profile + setting the config it all works fine.


(In reply to alex from comment #7)
> When testing with www.20minutes.fr, I get the following error in the console
> :
> 
> HarCollector.onNetworkEventUpdate; ERROR Unknown event actor:
> networkEventUpdate
> 
> 
> with other websites ( www.google.com for ex ), no such error, but no har
> neither!
Unfortunately opening the developer toolbox first is not really a fix.

If you need to capture the traffic generated by pop-up windows then you have to set-up a listener or otherwise intercept the window creation process in order to open the toolbox as soon as a new window opens. 

As the network requests are already happening in a separate thread you have a race condition which means you cannot reliably capture all the initial requests.
(In reply to Dan Boresjö from comment #9)
> Unfortunately opening the developer toolbox first is not really a fix.
> 
> If you need to capture the traffic generated by pop-up windows then you have
> to set-up a listener or otherwise intercept the window creation process in
> order to open the toolbox as soon as a new window opens. 
> 
> As the network requests are already happening in a separate thread you have
> a race condition which means you cannot reliably capture all the initial
> requests.

I agree with you completely Dan. "Fix" was a bad choice of word on my part. I was just glad to find out why the Har files weren't being generated as Honda described. 

I'm actually looking for a solution to the very problem you just described. In my experiment (as it is now) I open a web page from the command line in a new window. Trying to then open the toolbox (as you described) would indeed create a race condition leading to loss of initial requests.

Back to the drawing board.
Great, I am glad it works, thanks for testing!

Also, there is a way that allows exporting HAR without the Toolbox.

1) Install HAR Export Trigger extension
https://addons.mozilla.org/en-US/firefox/addon/har-export-trigger/
(you need Firefox 42+)

2) Set the following prefs in your Firefox profile:
devtools.netmonitor.har.enableAutoExportToFile;true // auto export when page load finishes
extensions.netmonitor.har.autoConnect;true // This one allows exporting without the Toolbox

You might also set:
extensions.netmonitor.har.contentAPIToken; "test-token" // Allows using HAR API exposed into the content.

HAR API can be used to trigger export at any time by a simple script implemented/injected into the page.

See more details: http://www.softwareishard.com/blog/har-export-trigger/

3) Launch Firefox and check your extension dir (the usual place) for HAR files.

---

I haven't tested popup windows myself, so if you see a problem please report it here: https://github.com/firebug/har-export-trigger/issues
+ detailed STR, so I can simple reproduce it on my machine and I'll fix it!

Honza
(In reply to Darren Cole from comment #6)
> I opened the (developer) toolbox then loaded the page and it works fine.
> This fix is actually so simple I feel rather silly now. Thank you Honza!
> 
> Perhaps you should include that bit of info. in your instructions for folks
Yeah, good point, doc updated.

Honza
Hi Honza,

I'm using Firefox 42.0 on Windows 7.

I installed the HAR Export Trigger extension as you advised but I don't seem to have the following pref:

 extensions.netmonitor.har.autoConnect;

The others are there but not this one. Please advise.
Hi All,

According to this: https://github.com/firebug/har-export-trigger/issues/13 , there is a compatibility issue with FF42 that Honza corrected recently. The new test build is available here: http://janodvarko.cz/temp/har/harexporttrigger-0.5.0-beta.7.11.1.xpi .

I replaced the existing .xpi file in my extension folder with the test build (changing the file name so it is the same as before. The pref extensions.netmonitor.har.autoConnect; is now available. I followed the instructions as before and I can now export the HAR files without the (developer) toolbox being open.

I need to test some more but so far it seems to be working well.
(In reply to Darren Cole from comment #14)
> Hi All,
> 
> According to this: https://github.com/firebug/har-export-trigger/issues/13 ,
> there is a compatibility issue with FF42 that Honza corrected recently. The
> new test build is available here:
> http://janodvarko.cz/temp/har/harexporttrigger-0.5.0-beta.7.11.1.xpi .
> 
> I replaced the existing .xpi file in my extension folder with the test build
> (changing the file name so it is the same as before. The pref
> extensions.netmonitor.har.autoConnect; is now available. I followed the
> instructions as before and I can now export the HAR files without the
> (developer) toolbox being open.
> 
> I need to test some more but so far it seems to be working well.
Thanks for pointing that out and for testing.

I just released new version (HAR Export Trigger 0.5.0 Beta 7)
See the release notes describing how to use the extension and execute export without the Toolbox:
https://github.com/firebug/har-export-trigger/releases

It's fairly new feature and I appreciate feedback!
https://github.com/firebug/har-export-trigger/issues

The signed version will be available on AMO soon (as soon as it passes the review process)

Honza
Is there anything else related to this report?
If not, I'll close it.

Note that issues related to the extension should be reported in the issue list on github.com
(see the previous comment)

Honza
(In reply to Jan Honza Odvarko [:Honza] from comment #16)
> Is there anything else related to this report?
> If not, I'll close it.
> 
> Note that issues related to the extension should be reported in the issue
> list on github.com
> (see the previous comment)
> 
> Honza

I'm good thanks.
Feel free, to open any follow-ups if needed.
Honza
Assignee: nobody → odvarko
Status: UNCONFIRMED → RESOLVED
Closed: 9 years ago
Resolution: --- → WORKSFORME
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.