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

ReferenceError: HAR is not defined #3

Closed
ghost opened this issue Sep 11, 2015 · 9 comments
Closed

ReferenceError: HAR is not defined #3

ghost opened this issue Sep 11, 2015 · 9 comments
Assignees

Comments

@ghost
Copy link

ghost commented Sep 11, 2015

I'm using HAR Export Trigger with Firefox 42 on Linux.

The scenario in which I get this error message:
I open firefox from commandline with an URL to my website on which the script to export the HAR data is run after a timeout of a few seconds.
If the netmonitor in firefox is not open while the export function is run, I get the error message "ReferenceError: HAR is not defined".
If I open the netmonitor manually before the export is run, everything is exported and the problem doesn't occur.
My problem is that firefox doesn't start the netmonitor automatically, but for my testing environment it is necessary that the export process runs automatically.

I'm not really sure if this is a problem that can't be fixed, because firefox can't export the data without an opened netmonitor, or if it is a problem with the har-export-trigger extension, so sorry if this is the wrong place to report this problem.

@janodvarko
Copy link
Member

This is the right place to report the problem.

I believe that the Developer toolbox must be open and any panel selected. I would actually recommend to select different panel than the "Network" since this panel can slow down page load and influence collected timing data.

So yes, opening the Toolbox is necessary at the moment (it initializes the devtools backend services that are required by HAR Export Trigger extension) and you can do it by sending F12 key event to the browser.

I'll yet explore more if it possible to have HAR Export Trigger working without the Toolbox being open, but it might take some time.

Honza

@janodvarko janodvarko self-assigned this Sep 11, 2015
@soulgalore
Copy link

Hey @janodvarko ,
wow I love what you have done with this! It's super cool that it's finnally possible to automate HAR creation using Selenium. We have started looking into to start using the har-export-trigger in Browsertime/sitespeed.io to be able to collect the HAR from from Firefox but struggling with opening the toolbox automatically. Do you know if there's a away of configuring it to always be open with about:config? Been trying a lot of different things but seems like nothing works for me.

Best
Peter

P.S again the HAR exporter is really awesome :D

@janodvarko
Copy link
Member

I don't know about such option (asking around to double check), but the question is how this should work. Do you mean that the Toolbox should be opened automatically for the first selected browser tab (after Firefox start), or for every opened tab? Or there should be two options?

Also Toolbox opening is asynchronous, so does the automation need an event saying "toolbox-ready"..? (e.g. sent to the page window just like "har-api-ready" event)?.

Those things could be part of this extension I guess.

Honza

@soulgalore
Copy link

I mean for me it doesn't matter how, more that it would be clean if we could find a way to skip opening it. or at least find a way to automatically do it when we open a new browser.

@janodvarko
Copy link
Member

OK, yes, I need to explore how to do all the automation without the Toolbox being open.

Honza

@soulgalore
Copy link

We gonna try just using the F12 from Selenium for now, but if there's possible to get rid of that it would be perfect. Thanks again for all the great work!

@janodvarko
Copy link
Member

Great, thanks, let me know if there are any additional features (apart the toolbox-not-needed) that could yet simplify the automation.

Honza

@janodvarko
Copy link
Member

I reported a new issue related to toolbox-not-needed #11

Honza

@janodvarko
Copy link
Member

And I believe I can close this one.

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

2 participants