firefox-devtools / bidi-har-export

Experimental module to compile WebDriver BiDi network events as a HAR file
7 stars 3 forks source link

https://www.aftonbladet.se generated three pages in instead of one. #24

Closed soulgalore closed 5 months ago

soulgalore commented 6 months ago

Hi!

I've been working on switching the HAR generator for Browsertime to remove the old exporter and only use bidihar but now I've been running in some issues. I've been using bidihar for Wikipedia for a long time and it works fine, but now when I tested other URLs I started to get errors.

Here's a HAR from https://www.aftonbladet.se (it's a Swedish newspaper site): https://gist.github.com/soulgalore/e4f84175ca1e15625be193279c3a26c3

When I check the HAR it has three pages (but should be one?). I wonder if these can be related to new changes in Firefox, I don't remember seeing it before. I also get the same kind of errors for cnet.com. Or should I do something differently when the HAR is collected?

juliandescottes commented 5 months ago

Thanks for the report!

@soulgalore looking at the HAR quickly, it seems that the other pages are related to iframes in the page. I think the recorder incorrectly consider iframe loads as new navigations and it messes up with the recording.

juliandescottes commented 5 months ago

I think it should be relatively easy to fix, we need to also listen to contextCreated in order to discard load events for non-top-level contexts.

juliandescottes commented 5 months ago

@soulgalore could you try v0.0.13 and see if that helps?

soulgalore commented 5 months ago

Yes it works fine now, thanks a lot @juliandescottes !

juliandescottes commented 5 months ago

Thanks for checking! Glad it's working now.