by saurik · 4y ago · 0 comments
But tbh I can't really imagine any scenario that is near impossible - except for WASM driven web pages which will break just about anything :(
Flash was at least easy to decompile. The decompiled code was so good most of the time that you could compile it back into a working swf, with modifications if you want any.
But then both WASM and Flash have to get the data from somewhere. That is usually something resembling an API endpoint that returns the result in XML or JSON. Why not sidestep the whole client app thing and go straight for that API endpoint?
It was eventually abandoned.
Two things make this vastly more difficult now:
1. Twitter uses obfuscated css classes that appear to change on every deploy, which makes scraping hard.
2. You used to be able to get around the limit on bookmarklet code size by adding a script tag to the page and loading remote javascript. Now browsers respect HTTP headers that sites can use so that only scripts from whitelisted sites are loaded.
% curl -s https://manifold.markets | htmlq '#__next > div > main > div.items-center.flex.flex-col > div > div.gap-8.flex.flex-col > ul > div > div > div > div.relative.flex-1.gap-3.pr-1.flex.flex-col > div.peer.absolute.-left-6.-top-4.-bottom-4.right-0.z-10 > a'
will get you all the anchors for the stories on the home page, and from there it's easy to get any other part of the stories.
www.google.com##div[role="heading"]:has-text(/^People also ask$/):upward(5)
www.google.com##span:has-text(/^People also ask$/):upward(5)
www.google.com##div[role="heading"]:has-text(/^Cast$/):upward(5)
www.google.com##span:has-text(/^Cast$/):upward(5)
www.google.com##h3:has-text(/^Videos/):upward(5)
www.google.com##h3:has-text(/^Images/):upward(5)
www.google.com##div[role="heading"]:has-text(/^People/):upward(5)
www.google.com##span:has-text(/^People/):upward(5)
www.google.com##h4:has-text(/^People/):upward(5)
www.google.com##span:has-text(Related searches):upward(5)
www.google.com##span:has-text(/^Latest/):upward(4)
www.google.com##h3:has-text(/^Top stories/):upward(6)
www.google.com##div:has-text(/^Trailers/):upward(4)
www.google.com##g-scrolling-carouselYou'd probably think it'd be simple, right? This being the kind of thing that Cascading Style Sheets were designed to handle elegantly and gracefully?
https://maya.land/user-styles/youtube/
I always thought people on here were just cranks complaining about style bloat, because a lot of the "this could have been a text file" arguments were applied to things that were genuinely better with the presentation polish. But this? How can developer ergonomics be worth this?
Anyway, user styles and user scripts and bookmarklets are all great and I use them all the time. This level of Big Tech deformation of the basic web technologies makes them more annoying, but still not impossible.