News for hackers. Stuff that matters.
Re:I miss the programmable web (2021) by saurik on Saturday July 30, 2022 @03:46AM (#32285077)
Would you mind giving me an example of something you've wanted to do that is really hard (or even nearly impossible) due to the these issues (so I have a standing concrete challenge case)?
Re:I miss the programmable web (2021) by pjerem on Saturday July 30, 2022 @08:28AM (#32286258)
As an example, I wanted to create a custom, more compact style sheet for JIRA (I don’t understand all those products with complex interfaces AND white space everywhere). I failed. It’s a PITA to write any selector and it wouldn’t survive the next build from the devs.
Re:I miss the programmable web (2021) by capableweb on Saturday July 30, 2022 @01:41PM (#32288701)
You don't have to select things based on CSS selectors. If you something really resilient, you select something based on the content of the elements (a button that says "Send" will rarely change to say something else, while the styling/DOM can change a lot). Otherwise xpath is another option of the DOM doesn't change a lot while CSS class/ID attributes changes between builds.
Re:I miss the programmable web (2021) by phil294 on Saturday July 30, 2022 @05:07AM (#32285376)
I have another fun challenge, try to completely disable the auto-zoom-feature on Google Maps. Last time I tried, I stepped through 20 stacks of obfuscated nonsense before eventually giving up.

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 :(

Re:I miss the programmable web (2021) by lgas on Saturday July 30, 2022 @07:10AM (#32285883)
why would WASM driven pages be any different to deal with than non-WASM driven pages?
Re:I miss the programmable web (2021) by klibertp on Saturday July 30, 2022 @11:02AM (#32287307)
You can't scrape HTML out of a rendered bitmap. It's not the only mode WASM can be used, but often all the rendering happens in the compiled code and the page only receives a series of images to display on a canvas. It's Flash all over again.
Re:I miss the programmable web (2021) by grishka on Sunday July 31, 2022 @03:41AM (#32293975)
> It's Flash all over again.

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?

Re:I miss the programmable web (2021) by RobbieGM on Monday August 01, 2022 @11:47AM (#32307737)
Almost nobody is doing this, and almost nobody ever will because it breaks accessibility and a whole host of other features. I would save the alarmism for another day.
Re:I miss the programmable web (2021) by klibertp on Tuesday August 02, 2022 @11:26AM (#32319780)
You're right about the accessibility and other features breaking. You're wrong in saying that (almost) nobody would do this. What (almost) nobody will do is creating an HTML-based rendering engine for windowing (GTK, Qt, wx, etc.) and graphical (SDL, DirectX, OpenGL, etc.) toolkits. It's technically possible, but maintainers have enough work with supporting just the 3 desktop and 2 mobile platforms. In the absence of a proper HTML rendering frontend, there's really nothing you can do other than compile the whole graphical stack and render into a canvas. That's the default for graphical apps under Emscripten - all games and GUI apps currently work that way. The only apps that have a HTML rendering frontend are CLI tools and REPLs, where it's trivial enough to rewrite the rendering in JS. There are frameworks currently being developed that allow rendering of widget trees in HTML or SVG, but they're still immature and not widely used. Well, WASM itself is not widely used, so it's normal.

BTW: were you around in the days of Flash? Because it broke accessibility and a whole host of other features the same way, yet it was still used and hugely popular (there was also ActiveX, which worsened things even more). It began with online games and graphics-rich pages, but it evolved frameworks for generic apps (ie. Flex) and then even CMS engines. Soon enough Flash was used for even blogs and e-commerce. The situation today is different due to the Web having evolved into a more capable and standardized platform, but there's no shortage of devs who would welcome the ability to run their app in the browser, but who dislike HTML/JS so much they would do basically anything just to not have to touch it - accessibility and a lot of other things be damned.

Don't underestimate how irrational people and even whole communities can be.

As a bonus, here's an example of the "almost" part: http://35.158.218.205/experiments/webDOOM/

Re:I miss the programmable web (2021) by tentacleuno on Saturday July 30, 2022 @06:12AM (#32285600)
Anatine[0] was a Twitter client maintained by Sindre Sorhus, a popular open-source maintainer. It made use of a userscript to add extra functionality to Twitter. Sadly, this meant keeping up with Twitter's ever-changing DOM class names.

It was eventually abandoned.

[0]: https://github.com/sindresorhus/anatine

Re:I miss the programmable web (2021) by debesyla on Saturday July 30, 2022 @05:22AM (#32285428)
Facebook and Instagram ads. Impossible to block through CSS now as the CSS classes are dynamically generated + it's even hard to pick out sponsored posts using .js too.
Re:I miss the programmable web (2021) by splintercell on Saturday July 30, 2022 @07:23AM (#32285954)
I am pretty sure that there is a team of engineers whose job is to office obfuscate ads on Instagram and Facebook.
Re:I miss the programmable web (2021) by acheron on Saturday July 30, 2022 @08:39AM (#32286319)
Surely these people can find something more beneficial to society to work on, such as selling heroin to middle schoolers.
Re:I miss the programmable web (2021) by geraldwhen on Saturday July 30, 2022 @11:47AM (#32287702)
Money is money. Few of the jobs I’ve worked have had a positive impact on society.
Re:I miss the programmable web (2021) by vntok on Saturday July 30, 2022 @07:03AM (#32285832)
From js, simply find all <a> tags that have a url containing "utm_medium=paid". Once you get them, for each tag element go up parentElements until the parent is <div role="feed">. Then remove the child.
Re:I miss the programmable web (2021) by nonameiguess on Saturday July 30, 2022 @09:12AM (#32286520)
Just block the entire feed and go directly to the profile pages of users you want updates from.
Re:I miss the programmable web (2021) by paulgb on Saturday July 30, 2022 @06:00AM (#32285554)
ca. 2014 I was able to write a bookmarklet that scraped a twitter thread by accessing the DOM (even causing page navigation) and rendering it as a reply-tree.

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.

Re:I miss the programmable web (2021) by tmaly on Saturday July 30, 2022 @12:57PM (#32288301)
Do older tweets get these new css classes when viewed after a deploy?

I could see using a set of standard tweets you created to sort of benchmark the change.

Re:I miss the programmable web (2021) by paulgb on Saturday July 30, 2022 @03:14PM (#32289453)
I imagine they would. That would be a good approach for data scraping, but difficult to do in a bookmarklet.
Re:I miss the programmable web (2021) by quickthrower2 on Saturday July 30, 2022 @04:32AM (#32285235)
Try it on a Tailwind & React based site. Lucky for a site like that it used NextJS so it has a lot of JSON state dumped in plaintext.
Re:I miss the programmable web (2021) by saurik on Saturday July 30, 2022 @05:38AM (#32285486)
I am asking for a concrete task challenge, not a kind of site or technology.
Re:I miss the programmable web (2021) by quickthrower2 on Saturday July 30, 2022 @06:04AM (#32285571)
Ok scrape data from manifold.markets
Re:I miss the programmable web (2021) by lgas on Saturday July 30, 2022 @07:18AM (#32285925)
Does it change a lot? Because it's pretty easy as is... eg.

% 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.

Re:I miss the programmable web (2021) by quickthrower2 on Saturday July 30, 2022 @08:33AM (#32286283)
It changes quite often. Since tailwind is utility based and not semantic it will likely break within the week.
Re:I miss the programmable web (2021) by christophilus on Saturday July 30, 2022 @07:06AM (#32285854)
Probably Tailwindcss.com, then?
Re:I miss the programmable web (2021) by saurik on Saturday July 30, 2022 @11:13AM (#32287409)
No, like "the website X is heavily obfuscated but I wish I had a userscript that could make Y modification". I work on runtime code modification tech, and am mostly known for my work on iOS and jailbreaking. Someone saying "there exist apps that use this weird compiler that are difficult to patch" isn't useful: I need a specific app and a specific target like "the Orchid app is using Flutter, which has its own weird Dart to native compilation step, which is making it almost impossible for me to use the tools we already have available to add a button that automatically builds multi-hop accounts".
Re:I miss the programmable web (2021) by switch007 on Saturday July 30, 2022 @03:59AM (#32285132)
Trying to block Google’s “people also search for” div (when you navigate back to the search results page) is not easy IIRC
Re:I miss the programmable web (2021) by potamic on Saturday July 30, 2022 @05:49AM (#32285518)
You can try these uBlock filters. Difference is night and day

    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-carousel
Re:I miss the programmable web (2021) by dceddia on Saturday July 30, 2022 @12:01PM (#32287808)
This thing drives me nuts! It’s always popping up JUST at the right time to catch my click when I’m aiming for the second search result. It’s been that way for long enough now that I’ve started to assume it’s like that on purpose, just to keep you from leaving.
Re:I miss the programmable web (2021) by kixiQu on Saturday July 30, 2022 @12:25PM (#32288013)
Override the font on all YouTube text elements.

You'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.