Live data from Hacker News

I miss the programmable web (2021)

matt-rickard.com

161–170 of 180 posts

Re: I miss the programmable web (2021)

#161
post #115

Earlier quoted context omitted.

javascript:if (typeof e!=='undefined') e.style.background='#ccc'; e=Array.from(document.querySelectorAll('.age%20a:not(.s)')).sort().at(-1); e.style.background='#ff0';e.classList.add('s'); e.scrollIntoView({behavior:"smooth",block:"center",});{} Looks like the code got mangled in the Twitter post, in particular the curly braces at the end. And the line order, "e=" should be at the beginning logically. javascript:e=Ar…

It is all one line. Yes, Twitter formats it in a way that makes it impossible to copy just the text. Because it thinks that .style is a toplevel domain and #ccc is a hashtag. Here is a repo from which it is easy to copy: https://github.com/no-gravity/hn-bookmarklet

Ah that's nice, thank you. Sorry I mis-rewrote when I tried to correct what was copied from Twitter. It addeded some extraneous "https://" too.

  javascript:if (!location.href.match('ycom')) {location.href='https://news.ycombinator.com'};if (typeof e!=='undefined') e.style.background='#c0c0c0';e=Array.from(document.querySelectorAll('.age%20a:not(.seen)')).sort().at(-1);e.style.background='#ff0';e.classList.add('seen');e.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"});{}
I see, that {} at the end is intentional, as you described in another comment.

And accessing the variable e before assigning it a value, now I see that probably serves a practical purpose too.

Re: I miss the programmable web (2021)

#162

My most used bookmark is this, for speeding up the first audio or video element on the page. I suppose that's if you don't count me typing 'n' and auto-completing my way to hacker news. javascript:(function() { (document.querySelector('video') || document.querySelector('audio')).playbackRate = (+prompt('How many times normal speed?') || 1); })();

For webkit based browsers, you can also use Video Speed Controller extension https://github.com/igrigorik/videospeed

But a bookmarklet saves you from having to run an extension at all times.

Re: I miss the programmable web (2021)

#163
post #160

Earlier quoted context omitted.

Check out Facebook’s Storybook if you haven’t already. It’s life changing when you don’t have to click through an app to get the state you need.

Do you have a link? I have a really hard time googling this.

https://storybook.js.org/

Re: I miss the programmable web (2021)

#164
post #105
post #29

Earlier quoted context omitted.

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)?

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.

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)

#165

I miss the 3D web. In the late 90's Silicon Graphics machines came with an out of the box experience delivered by Netscape Navigator. The page was rendered in frames, so you only downloaded the navigation frames once, not with every click. Some of this navigation and some of this content was in VRML that you could interact with. The full product tour could be explored in a 3D world. The UI UX did not seem OTT. It fel…

I would love to see what those UIs looked like, but I'm completely unfamiliar with it. What should I search on Google to get proper results?

Re: I miss the programmable web (2021)

#166
My most used bookmarklets are two: both find the last number in the URI path and increment or decrement that number. Perfect for paged websites. I'm using these for almost twenty years. If sometimes Safari removes the function to activate Favorites via ⌘1 to ⌘9 my whole muscle memory will be screwed.

For almost twenty years I'm thinking of expanding these two bookmarklets to use the rel=next/previous link relations instead, but I don't have high hopes in the quality of the markup of the web anymore. Which is a small problem for the idea of a programmable web. The deeply nested div trees which often result of modern frontend development and weird CSS methodologies are as worse as the table layouts of yore.

Re: I miss the programmable web (2021)

#167
post #159
post #63

Earlier quoted context omitted.

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 a…

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.

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)

#168
post #22

I miss: bookmarklets and user scripts I use bookmarklets all the time. I can't imagine living without them. For example, this is how I read HN: https://twitter.com/marekgibney/status/1551483561621979136 The bookmarklet takes me to the latest HN post I have not seen. When I click it again, it takes me to the next I have not seen. As soon as I see a post I have seen before, I know I am up to date. I can't imagine readi…

last I checked archive.is had killed its bookmarklet, which is very annoying

haven't checked in a while though, maybe there are workarounds

Re: I miss the programmable web (2021)

#169
post #10

Huh? Userscripts are dead according to author, but I apparently never got the notice because I have about a dozen of those things installed right now. Three of them are for YouTube because it's this much annoying as is.

Many sites are turning on CSP, a web security capability which lets sites block loading content from anywhere they don't allowlist. Userscripts will run, but if they try to load any content from elsewhere, that breaks. So, for example, the Hypothes.is extension wont load. Affected sites keep growing. https://twitter.com turned on CSP many years ago.

This is such a silly problem to have. User agents that want an exception to a policy are free to make one.

Re: I miss the programmable web (2021)

#170
post #153

> I made it possible to generate a new document by loading, e.g. javascript:'hello, world' It never occurred to me to try, but I think this is still possible even without the javascript: URI scheme, as there’d be nothing stopping you from putting an inline in an HTML page described by a data: URI, and bookmarking said data: URI. Not sure what the browser would consider that data: page’s HTTP origin to be for cookie /…

Data URLs have a null origin and don't count as secure.
Post reply on HN