david-dick / firefox-marionette

This is a client module to automate the Mozilla Firefox browser via the Marionette protocol
https://metacpan.org/dist/Firefox-Marionette
Other
12 stars 3 forks source link

Perl: javascript error: ReferenceError: HAR is not defined #32

Closed 532910 closed 9 months ago

532910 commented 10 months ago

With new(har => 1) I get Perl: javascript error: ReferenceError: HAR is not defined from time to time.

david-dick commented 10 months ago

I'm not sure what causes this, but I have seen this on FreeBSD, Win32 and cygwin. Are you getting this on a different platform?

532910 commented 10 months ago

Yep, on linux, debian stable.

532910 commented 10 months ago

https://github.com/firefox-devtools/har-export-trigger/issues/27

could this be related?

david-dick commented 10 months ago

probably not, as the har => 1 argument to Firefox::Marionette->new() already automatically loads the devtools window, but I'm not having a lot of luck reproducing this one. Do you have a script that can reliably reproduce the issue?

david-dick commented 10 months ago

I can reproduce the issue when loading a website that is very quick to load (a local nginx server returning a single html page). Does that sound like it matches your environment?

david-dick commented 10 months ago

I've attached a small patch here to show a solution to the issue I described above. If that matches your issue, could you apply the patch to your local install and see if it fixes the issue? har.patch

david-dick commented 9 months ago

Any chance you can test this? I've included the patch in the attached package Firefox-Marionette-1.50_01.tar.gz

532910 commented 9 months ago

Sure! Hope I'll test it this weekend.

david-dick commented 9 months ago

Just a ping on this one?

david-dick commented 9 months ago

I think this is fixed now. There are new packages available on CPAN with the fixes included. Please reopen this bug if you encounter this issue again.