sitespeedio / chrome-har

Create HAR files from Chrome Debugging Protocol data
MIT License
149 stars 50 forks source link

How to determine if a request was preloaded ? #93

Open ghisleouf opened 2 years ago

ghisleouf commented 2 years ago

Hi guys,

First of all, thanks for your amazing work! That's huge !

I would like to determine from HAR generated file which request was preloaded (or not) during page loading. Is there a way to determine it easily ?

Thanks for your help.

Best.

soulgalore commented 2 years ago

Hi @ghisleouf thanks for the kind words! HAR doesn't support that but we could maybe add it is a extra field. I briefly looked into the trace log where there's preloading (I tried with shopify.com) and there's a request field "isLinkPreload": true that maybe means that it is preloaded? If so, we could add it. Can you help me find out more if that's what it means?

Best

ghisleouf commented 2 years ago

Hi @soulgalore !

That's exactly what I'm looking for ! This is this exact field.

I'm quite new to HAR world :)

Actually, I working on a HAR viewer where trace log comes from Lighthouse CLI report. I compared HAR with another one coming from another SaaS service and I would like to understand the way to add field and mimic some interesting data that they have.

That would be definitely awesome to have it.

Thanks for your help.

soulgalore commented 2 years ago

Hi @ghisleouf wanted to check if you know about https://github.com/micmro/PerfCascade?

I can add that field sometimes early next week, or do you have time to do a PR?

ghisleouf commented 2 years ago

Yes ! I know this viewer, thanks for sharing. Unfortunately, I'm a little bit busy these days ( moving my new house, and working no it)... so, it would be perfect if you could add it on your side, even if I have to wait 😄 !

Thank you so much !

soulgalore commented 2 years ago

I added a PR that just copies it to _isLinkPreload on the request.

Is it anything special that stops you for using PerfCascade? Michael is always open to PRs and adding functionality.

ghisleouf commented 2 years ago

Thank you so much for the update @soulgalore ! For PerfCascade, I cannot use it because I need a totally custom display on my side and data is driven by a PHP application and Stimulus library (the main reason is PHP and Twig templating, and design that I have to respect).

Thanks a lot for your help again. Can't wait for the release :)