Re:Web scraping via JavaScript runtime heap snapshots
by asabla on Friday April 29, 2022 @05:49PM
(#31210949)
Well kind of for Firefox, there is this profiling tool which you could use (semi-built in)
https://github.com/firefox-devtools/profiler. Which let you save a report in json.gz format
Re:Web scraping via JavaScript runtime heap snapshots
by nmstoker on Friday April 29, 2022 @07:19PM
(#31211726)
I had understood that Playwright actually used the DevTools protocol rather than the WebDriver protocol, as mentioned here:
https://github.com/microsoft/playwright/issues/4862
And there's a bit of detail about how they're different here:
https://stackoverflow.com/q/50939116/142780
However that's more a detail and doesn't really undermine your point about Firefox / Safari being handled differently, it's just that Playwright implemented their own versions of the protocol for those two non-Chromium based browsers
Re:Web scraping via JavaScript runtime heap snapshots
by nousermane on Sunday May 01, 2022 @07:25AM
(#31224096)
> Firefox does have a memory snapshot feature, but the file it saved is some kind of binary encoded thing without any obvious strings in it
Those .fxsnapshot files are gzipped binary heaps. There is a 3rd-party decoder for it:
That means that if you are running against Chromium, this will likely work, but unless Firefox has a similar heapdump function, it is unlikely to work[1]. And almost certainly not Safari, based on my experience. All of that is also qualified by whether Playwright exposes that behavior, or otherwise allows one to "get into the weeds" to invoke the function under the hood
1 = as an update, I checked and Firefox does have a memory snapshot feature, but the file it saved is some kind of binary encoded thing without any obvious strings in it
I didn't see any such thing in Safari