News for hackers. Stuff that matters.
Re:Web Scraping via JavaScript Runtime Heap Snapshots (2022) by c0balt on Tuesday August 08, 2023 @09:29AM (#37048680)
Huh, I'm surprised this gets past the symbol mangling done by most js minifiers. Though maybe they don't mangle attribute fields everywhere.

However this is a nice hack around "modern" page structures and kudos to the author for making a proper tool out of it.

Re:Web Scraping via JavaScript Runtime Heap Snapshots (2022) by bugsliker on Tuesday August 08, 2023 @09:41AM (#37048844)
It's the JSON data payload that has unminified keys. Though YouTube is one of the few google sites that still use JSON, most use protocol buffers which generate JS interfaces which would indeed be mangled by minifiers.
Re:Web Scraping via JavaScript Runtime Heap Snapshots (2022) by madeofpalk on Tuesday August 08, 2023 @09:45AM (#37048882)
Most/all minifiers won't actually mangle object property names as those often have observable side effects. You want to grab all the keys for an object and do something different depending on the name of the key - you can no longer do that if the minifier has mangled all the object keys. Not to mention I imagine it would be significantly harder track all references to object keys across an application (as opposed to just local variables).
Re:Web Scraping via JavaScript Runtime Heap Snapshots (2022) by btown on Tuesday August 08, 2023 @10:00AM (#37049083)
As I recall, the only minifier that went this far was Closure Compiler [0] - the caveats documented there still apply!

(Fun fact: I believe that Closure Library, and by extension the Closure Compiler, are still used for the Gmail rich text editor! [1])

[0] https://developers.google.com/closure/compiler/docs/api-tuto...

[1] https://google.github.io/closure-library/source/closure/goog...

Re:Web Scraping via JavaScript Runtime Heap Snapshots (2022) by nathell on Tuesday August 08, 2023 @11:48AM (#37050843)
And ClojureScript.
Re:Web Scraping via JavaScript Runtime Heap Snapshots (2022) by madeofpalk on Tuesday August 08, 2023 @01:12PM (#37052352)
ClojureScript, being a completely different language which merely uses Javascript as a compilation target lends itself to significantly different optimisation methods.