I Miss the Programmable Web

In some ways, we've taken a few steps back from a programmable web—two things I miss: bookmarklets and user scripts. Imagine having a bookmarked shortcut to do complex things like taking screenshots or saving a PDF. Or running scripts to automatically change the styling of websites, removing annoying sections (not just ads!). All of this used to be possible.

Brendan Eich, the author of JavaScript, thought that we'd use JavaScript bookmarklets to run arbitrary scripts against the DOM:

They were a deliberate feature in this sense: I invented the javascript: URL along with JavaScript in 1995, and intended that javascript: URLs could be used as any other kind of URL, including being bookmark-able. In particular, I made it possible to generate a new document by loading, e.g. javascript:'hello, world', but also (key for bookmarklets) to run arbitrary script against the DOM of the current document, e.g. javascript:alert(document.links[0].href). The difference is that the latter kind of URL uses an expression that evaluates to the undefined type in JS. I added the void operator to JS before Netscape 2 shipped to make it easy to discard any non-undefined value in a javascript: URL. —?Brendan Eich, email to Simon Willison

User scripts took this even further – Greasemonkey (and its successor Tampermonkey) – hosted a repository of scripts you could install and run on specific websites. These scripts added functionality to websites before companies could (or would) implement them – e.g., usability features for common sites like YouTube (add a download link), a queue for Netflix shows, or direct image links for Google Image Search.

Security policies have essentially killed the user script and bookmarklet ecosystem. Most of the scripts you can find on the remaining sites like Greasy Fork only provide minor improvements. The most-used scripts – like ad-blocking or annotating have become their own standalone browser extensions (e.g., AdBlock and Evernote/Notion Web Clipper).

The security benefit to consumers of blocking user scripts is probably a net positive for the average internet user. But why can't we have both? Surely we can find a way. Maybe running something like the QuickJS sandbox inside WebAssembly can provide a more secure way to access selective parts of the DOM.

Angus Mitchell

Founder at Flank

1 年

How are user scripts different than a browser extension that runs a script? And do you understand the motivations behind the security restrictions? I’ve read the XSS MDN page like 5 times but it’s never sunk into my brain, probably because I don’t understand the original motivations

回复

I just found your blog randomly. it's great!

要查看或添加评论,请登录

Matt Rickard的更多文章

  • Lessons from llama.cpp

    Lessons from llama.cpp

    Llama.cpp is an implementation of Meta’s LLaMA architecture in C/C++.

  • To be, or not to be; ay, there’s the point.

    To be, or not to be; ay, there’s the point.

    It doesn’t have the same ring to it as the Hamlet that we know, but this is from the first published version of Hamlet…

  • AI Agents Today

    AI Agents Today

    The term AI agent is used loosely. It can mean almost anything.

  • Norvig's Agent Definition

    Norvig's Agent Definition

    There’s no consensus on what an AI agent means today. The term is used to describe everything from chatbots to for…

    1 条评论
  • The Lucretius Problem

    The Lucretius Problem

    Just as any river is enormous to someone who looks at it and who, before that time, has not seen one greater. So, too…

    1 条评论
  • Eroom's Law

    Eroom's Law

    Despite advances in technology and increased spending, the number of new drugs approved per billion dollars spent on…

    1 条评论
  • Copilot is an Incumbent Business Model

    Copilot is an Incumbent Business Model

    The Copilot business model has been the prevailing enterprise strategy of AI. An assistant that helps you write the…

    1 条评论
  • What if Google Wasn’t The Default?

    What if Google Wasn’t The Default?

    Google has paid Apple to be the default search on their operating systems since 2002. But recent antitrust cases…

  • The Cost of Index Everything

    The Cost of Index Everything

    Many AI products today are focused on indexing as much as possible. Every meeting, every document, every moment of your…

  • Strategies for the GPU-Poor

    Strategies for the GPU-Poor

    GPUs are hard to come by, often fetching significant premiums in their aftermarket prices (if you can find them). Cloud…

社区洞察

其他会员也浏览了