Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export HAR without the Toolbox being open #11

Closed
janodvarko opened this issue Nov 6, 2015 · 16 comments
Closed

Export HAR without the Toolbox being open #11

janodvarko opened this issue Nov 6, 2015 · 16 comments
Assignees

Comments

@janodvarko
Copy link
Member

It should be possible to export HAR without the Toolbox being open. This would nicely simplify HAR export automation.

Honza

@janodvarko
Copy link
Member Author

@soulgalore
Copy link

thanks looks promising! :)

@JosephCastro
Copy link

Please!

@janodvarko janodvarko self-assigned this Nov 10, 2015
janodvarko added a commit that referenced this issue Nov 10, 2015
@janodvarko
Copy link
Member Author

HAR API are not exposed to new tabs (about:newtab) in case e10s is on.
Caused by: https://bugzilla.mozilla.org/show_bug.cgi?id=1068400

The client (target) isn't firing "navigate" (neither onTabNavigated) event when about:newtab tab is navigated to another location. There is only "close". So, there is no way how to expose HAR API to the new loaded page.


@soulgalore @JosephCastro: The problem is only related to e10s, where the feature works only on the tab opened by default after Firefox launches (or tabs restored by the session manager).

What is actually your scenario? Are you loading pages directly in the default browser tab or opening other tabs as well? How typical scenario looks like?

Honza

@soulgalore
Copy link

The typical use case for us: We start the browser, load the URL directly in the default browser tab (we never open other tabs), collect some metrics using javascript and then close the browser.

Peter

@janodvarko
Copy link
Member Author

There is a new preference: extensions.netmonitor.har.autoConnect (set to false by default)
If you set it to true, HAR object should be available on every page by default.

There is an event 'har-api-ready' sent to the content window. You might want to handle it to know since when the HAR object is available. The HAR object isn't available immediately after a browser tab is opened, but it's there till you close the tab. So, if you navigate/refresh the tab the HAR object is there all the time.

There is limitation if e10s is on. New tabs opened through about:newtab (i.e. clicking on the + button in the tab bar and consequently load the content) don't have the HAR object. However if you open a new tab through a link (Open In New Tab) it should work. The issue will be gone when https://bugzilla.mozilla.org/show_bug.cgi?id=1068400 is fixed.

I need feedback now.
Do you want me to generate xpi for you?

Honza

@soulgalore
Copy link

Wow sounds great. If you could generate an xpi I can test it asap.

@janodvarko
Copy link
Member Author

@soulgalore
Copy link

Thanks! Tested but I couldn't get it to work, maybe I do something wrong? First: I've got a test I use where I push the F12 using Selenium, it worked in the old version but when I only switched to the new xpi (didn't changed anything else), it failed (meaning no HAR object), is that expected? If I switch back to the old xpi it works.

@janodvarko
Copy link
Member Author

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

@soulgalore
Copy link

Have everything automated so it's hard to see, will look into it tomorrow. Did a quick test manually and then your test page worked for me, so it could be something on my side, but I need some time to go through it.

@janodvarko
Copy link
Member Author

Sure, thanks for testing!

@soulgalore
Copy link

ok, should the new version work in FF 42? When I test it now (I needed to clean my environment to get everything ok), I've set the following:
screen shot 2015-11-12 at 10 39 07 am

But I don't get it to work at all on the test page when I click on HAR export:
screen shot 2015-11-12 at 10 39 45 am

Or could I have missed a config?

@janodvarko
Copy link
Member Author

Ah, it was a compatibility issue with Fx 42 (I didn't test it). Here is another fixed version:
http://janodvarko.cz/temp/har/harexporttrigger-0.5.0-beta.7.11.1.xpi
(your config is just fine)

Does this version work for you?

Honza

@soulgalore
Copy link

YES it works now, super! Works both testing manually and automated. Thanks, this is super cool.

@janodvarko
Copy link
Member Author

Excellent, thanks for verification.

Honza

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants