14 ms·
I miss the programmable web (2021)
- LAC-Tech 4y agoHow did these user scripts work? I don't get how they could be "blocked" now. I've made my own snippets of JS to run on certain sites before.
- wincy 4y agoIt was a little frustrating the last time I wrote a Tampermonkey script, mostly because React is being used on the site and I had to find some algorithms to traverse the state being stored in the React Fiber required some DOM traversal and knowing about the inner workings of React to figure out things like the Download URLs I needed for my script to work. Basically I had a list of files that I own on their site and wanted a "download all" button, so I made one. It added a substantial amount of complexity but it wasn't insurmountable. The scripts he talks about sound like there's stuff I'd have to sub in a shell script or use a two stage process to do, as there is some post-download processing I'd like to do automatically, but there's no way for me to access my OS from the sandbox of Firefox (I mean, for good reason, although it would be nice if I could override that in some cases)
- Ayesh 4y agoSites can impose a Content Security Policy, that (among other things) can disable inline JavaScript. This makes it a real PITA to modify web sites with user CSS/JS. I am personally aligned with pro-CSP because it can greatly reduce the attack surface of web sites I host, and is quite effective and precise. Browser extensions can, and do, play around CSP. Bookmarklets has no overhead in the browser, because they are just bookmarks that do not interact with the browser unless I click it. Having a little addon for each little functionality is annoying, slow, and difficult to maintain and review.
- progval 4y agoWhy do browsers enforce CSP against bookmarklets and user scripts, though?
- TBurette 4y agoThe goal is to prevent any way for attackers to inject code. Bookmarklets and user scripts are collateral damage.
- andai 4y agoThat's probably the right choice, but it sounds like there should be a "captcha" to separate programmers from non-programmers. The browser remains in a locked down kiddie mode until you solve these riddles three!
- matkoniecz 4y agoNaive users can be convinced to run random code. Go to discord.com (no need for account) and open browser console. You will see > Hold Up! > If someone told you to copy/paste something here you have an 11/10 chance you're being scammed. > Pasting anything in here could give attackers access to your Discord account. presumably they added it after it kept happening. And likely the same things happens when random user can somehow run code they got from scammer :(
- wruza 4y agoI can see something like that as a separate red box above the actual console in opera and firefox, regardless of the current site. Annoys me as hell, cause there is no way(?) to turn it off.
- ptx 4y agoIt looks like Mozilla fixed it for bookmarklets[1] three years ago in Firefox 69. [1] https://bugzilla.mozilla.org/show_bug.cgi?id=1478037 https://bugzilla.mozilla.org/show_bug.cgi?id=1478037
- rektide 4y ago
- hiram112 4y agoI don't see how this could be truly secure if it's JS running on the client. There is nothing stopping a user from running a custom version of Chromium or otherwise that ignores CSPs... Maybe I'm not fully understanding what is being restricted here and where the code is being run.
- charles_f 4y agoI guess it's reducing the attack surface for your users, as you can't have a malicious userscript that would log your cc number or something
- ozten 4y agoI thought this would be about the glory days of “Mash-ups” using web APIs. Flickr + Twitter + Delicious tags to create a new experience. 2007 ? What a period to be a hacker!
- ngc248 4y agoOh those were the days. Yahoo pipes and all of the various mashups. Then the walls started closing in :(
- anonyfox 4y agoIf we could *force* all the walled gardens to have an open API again, like some of them had back in the day, that would solve soooo many issues. Make all the data free to use for everyone, while ML techniques get even more accessible, and let people build products with that - where they also have to provide APIs for their enriched data.
- xorcist 4y agoEven at the time, html scraping was necessary for a lot of things. And lots of services that has open APIs requires access keys. I'm allowed to read your twitter feed in html anonymously, but for json I need to apply for an account in advance and login, for example. Even if we could force open APIs, it's not sufficient.
- juliendorra 4y agoWe can, via policy and regulations! EU would be your best bet for lobbying, as Open Data is already mandatory for public data, and an extension to some privately produced data is not out of the question (it was discussed for transport data for example, ie. Uber data)
- naillo 4y agoI suspect part of why they closed open APIs down is because it was abused (for spam or similar). Not sure how to convince them to open it back up in light of that.
- andrewstuart2 4y agoMy 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); })();
- thunderbong 4y agoFor webkit based browsers, you can also use Video Speed Controller extension https://github.com/igrigorik/videospeed https://github.com/igrigorik/videospeed
- dicknuckle 4y agoOn YouTube I've had a great experience using Sponsorblock which crowd sources categorizing different parts of the video. If a bunch of people categorized the first 10 seconds of a particular video as "Intro", that section of the video scrub/seek bar is highlighted in a color that represents that category. I have Sponsorblock set to skip Intros, so I never see them unless it's a very very fresh video that nobody has categorized yet. It's baked into YouTube Vanced on mobile, which was sadly taken down by Google. Smart Tube Next is another Android app with this feature, but I'm not sure if it's available for anything other than TV set top boxes.
- pvorb 4y agoBut a bookmarklet saves you from having to run an extension at all times.
- thegeekpirate 4y agoHere's the fork that added Firefox support (https://github.com/codebicycle/videospeed https://github.com/codebicycle/videospeed, https://addons.mozilla.org/en-US/firefox/addon/videospeed/ https://addons.mozilla.org/en-US/firefox/addon/videospeed/), and it's saved me so much time it's absolutely ridiculous at this point.
- deleted 4y ago[deleted]
- drran 4y agoIMHO, we need a browser optimized for power or professional user experience (PPUX), instead of browsers optimized for dumb users (DUX).
- ehecatl42 4y ago¿ https://nyxt.atlas.engineer/ https://nyxt.atlas.engineer/ ?
- pmontra 4y agoSometimes I use curl with a session cookie copied from the developers tools. I never automated that part. I don't even know if it is possible.
- dijit 4y agoWe have a lot of those, but they're not as popular of course. Qutebrowser is my favourite among them.
- bmn__ 4y agoThat was Opera browser up to version 12 and its spiritual successors, notably Otter browser. • https://news.ycombinator.com/item?id=27695463 https://news.ycombinator.com/item?id=27695463 (2021-07, 96 comments) • https://news.ycombinator.com/item?id=18830430 https://news.ycombinator.com/item?id=18830430 (2019-01, 47 comments)
- int_19h 4y agoI think Vivaldi comes the closest, if you're okay with a non-FOSS browser.
- isodev 4y agoKind of reminds of the days of Yahoo! Toolbar and friends. I think today we have several ways we can go about this. There are browser extensions that can be used to both complement and alter the behavior of a website. Extensions can interact with the OS and other apps on a system which offers a lot of potential for integrations and customization. (e.g., on iOS/macOS, Shortcuts allow integrations with 3rd party apps, AppleScript, PowerShell (on Windows), etc.)
- grishka 4y agoHuh? 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.
- abvdj2 4y agoWhat do your user scripts do if you don't me asking? On a site note: Been looking for one to show reccomendations always based on simmiliar vids, not my recently watched and whatever the black box algorithm is offering me. Unfortunately I never figured out how do it properly, since the position of the element seems to be random and sometimes straight up missing.
- grishka 4y agoThe YouTube ones? 1. Prevents channel page video from auto-playing (not mine) 2. Removes the stupid custom scrollbar that takes up actual pixels on my screen at all times 3. Automatically sets highest available video quality by clicking through the quality menu so I don't have to And those are in addition to SponsorBlock and uBlock Origin extensions.
- incangold 4y agoThe one that switches off the comments section makes the platform quite a bit more pleasant
- ta8903 4y agoI use one to redirect youtube shorts pages to the regular youtube UI. Also one for old.reddit.
- zebracanevra 4y agoI made one for youtube that moves the seek bar below the video, instead of on top of the video. In addition it removes the gradient etc. I've always hated how it covered up the content. (pure css, but still)
- pjerem 4y ago
- beebeepka 4y agoI don't miss them very much. The whole thing was a security nightmare and I am glad Mozilla dropped XUL. I think they truly had to. I get the utility but I suspect writing greasemonkey scripts for SPAs might not be a great experience.
- simonh 4y agoThat’s not a knock against Greasemonkey…
- ddoice 4y agoI got my first dev job at a call center because bookmarklets, I was a phone operator and hacked some internal websites to improve the UX and the speed, everyone ended using these bookmarklets (coded in word and then minified running another script in the browser console). Grease monkey is still alive, I added voice recording and speech to text transcription to Slack before they did.
- Theodores 4y agoI 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 felt like the future. It turned out that the excellent CosmoWorlds VRML authorship tools were just a little bit ahead of their time and there was little of the expected interest. We ended up with a flat 2D web rather than a 3D web. Sure this makes sense but the tools you have available frame how you solve problems. Also out the box was a web server. You put HTML (and VRML) in your shared web folder and your machine instantly had your stuff available on the local network and you could route to the machine from the internet if you had the networking skills to set that up. It was all in the original Tim Berners Lee vision, you could imagine how this would make sense in academia, with academics in a department able to put all their work/knowledge on the web very easily. In this SGI version of the 3D web it was the javascript that glued it all together, VRML was made useful with scripting which could go across those frames to put together an awesome web experience, rose tinted spectacles accepted. We aren't even thinking along those lines these days. The web has gone, we have platforms now.
- meesterdude 4y agoWe aren't even thinking along those lines these days. Some of us are. My side project is in many ways a 3D web; and i know I'm not alone in exploring the domain.
- rektide 4y agoThere's been good webgl & webgpu work. Whats been sad is that none of this is hypermedia like. I kept hoping I could someday have some DOM surfaces I could put inside the 3d game. Apple's been driving a "model" element for the web. Personally Im unthrilled that it's an object but bereft of an environment; there s no real space or navigability.
- hidden-spyder 4y agoI 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?
- mg 4y agoI 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 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 reading HN any other way. Because otherwise, I would have to skim the whole front page to see what's new. It also works on threads. So, when I post something on HN and want to see the latest replies, the same bookmarklet does this for me. I have bookmarklets for every site I use frequently.
- schwartzworld 4y agoI use then to automate annoying workflows for FE development. Sometimes you need to click through a series of things to get the UI into the state you need. A bookmarklet is a perfect solution.
- lanktastic 4y agoCheck 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.
- lobstrosity420 4y agoStorybook is awesome. Just wanted to clarify is has nothing to do with Facebook or Meta.
- geraldwhen 4y agoIt is also trivial to turn storybook into visual regression tests.
- b15h0p 4y agoDo you have a link? I have a really hard time googling this.
- tannhaeuser 4y agoOn a related note, Chrome has removed its user stylesheet feature years ago. I've often asked myself why we then still need this "cascading" of style sheets. It seems to have degenerated into a feature for web developers who can't make up their minds, and pushing conflicting styles to every browser for late evaluation, negatively impacting energy consumption. Or maybe they want component-like behaviors from their third-party stuff they can then adapt and override, but at the same time the comfort of not having to do so when unnecessary? And they don't want preprocessing either; nope, it has all to be in the browser, with accessibility a fig leaf for this complexity. In other words, CSS was hijacked by web devs for their convenience, as can also be seen by the custom properties feature, the upcoming nesting feature, and so on. Another way to say this is that we have web developers now when the original web was for web authors.
- pbhjpbhj 4y agoIsn't this just how technology progresses? Things start off as amateur pursuits but once a field becomes profiting making then professionals move in and industrialise things.
- tannhaeuser 4y agoMaybe, but somehow Microsoft Office with its VBA macros has managed to remain sane in comparison ;)
- arrow7000 4y agoThis is a good response to the vast majority of curmudgeonly HN posts tbf
- bigDinosaur 4y agoC'mon, let's not imply that web developers are, generally speaking, professional. ;-)
- tannhaeuser 4y agoIdk "it is what it is" doesn't make an interesting conversation OTOH, does it?
- system2 4y agoMaybe because we have an extension for almost everything. If not enough, tempermonkey still works for nearly everything I am doing. I also use stylebot here and there for visuals and block elements with adblock. I am not sure if I understood the author's problem.
- FrozenVoid 4y agoWriting userscripts and CSS filters becomes more tedious each few years, especially mucking with dynamic DOM and complex frameworks websites tend to use now. WASM and obfuscated/minified javascript made "programmable web" impossible in practice.
- mark_and_sweep 4y agoAgreed, except MutationObserver has made dealing with DOM modifications much easier.
- mark_and_sweep 4y agoI'm still happily using userChrome.css and userContent.css in Firefox to customize both its UI as well as a couple of sites I visit regularly. To do so, you need to enable toolkit.legacyUserProfileCustomizations.stylesheets in about:config.
- cantSpellSober 4y agoI use an extension like Stylus to sync these across browsers and devices
- 5350-uiop-1130 4y agoI miss the "immediate web". Being able to work on simple things without feeling like they are useless, pointless or perceptibly outdated. Now it's install node, install git, install npm, install a gazillion packages, run localhost then hope everything works. Build command, clean command, eject commands, deploy command, pre processors, post processers, documentations full of so much jargon that i feel burnt out looking at it, hydration rehydration, pre-rendering, headless cms....on and on. I find myself reverting to writing simple bash scripts, userscripts - they are more enduring, not built on a stack of fickle dependencies, fads and ever increasing complexity.
- rtpg 4y agoYou can choose not to use most of that stuff. I recently moved some stuff over to esbuild and that's been pretty helpful for that. Jest is a big and heavy thing but I've found it's the test framework that gives the least headaches without really needing to be configured. And of course deploying can be a one-line "run esbuild with the output going here". Or even check in the artifacts! You lose the nice stuff like livereload but you can hack in something to that effect if you want to.
- blauditore 4y agoIf you build web pages without the whole JS frameworks and Node circus, they are pretty durable. Those helpers were invented because people started to build empires (complex applications) on sand (the web), so they are pretty useful for larger projects, but simple websites can still be easily built with plain HTML/CSS/JS.
- 5350-uiop-1130 4y agoyeah but there is no value, personally in building projects like that anymore, you can not use them in your portfolio or to progress your career - i was going to build a personal site, but realised it would probably act as more of a hindrance to me, because potential clients/employers would see that it was not using latest new js fad. if it was up to me i would never touch those things, but that's what the market has become. i even resisted learning typescript for so many years, because i loathe the idea of learning a language that needs to be converted to have correct syntax. same with jsx, i use it, but it feels horrible.
- contentboot 4y ago>The security benefit to consumers of blocking user scripts is probably a net positive for the average internet user. Strong disagree. Extensions and User scripts are an unmapped wild west. Providing a registry type system to securely vend packages/scripts is a very hard security problem. https://www.bleepingcomputer.com/news/security/mozilla-blocks-malicious-add-ons-installed-by-455k-firefox-users/ https://www.bleepingcomputer.com/news/security/mozilla-block... https://iamakulov.com/notes/npm-malicious-packages/ https://iamakulov.com/notes/npm-malicious-packages/
- yoyopa 4y agothis has nothing to do with security and everything to do with trying to charge $4.99 a month for everything to the maximum extent permissible under law.
- adrusi 4y agoIt's become harder to develop stupid simple bookmarklets because modern web pages are trickier to reverse-engineer, the market has expanded by a lot, and now people can make working on handy WebExtensions their full time job, and those are nothing more than bundled userscripts and bookmarklets that have access to some bonus APIs. It used to be browser extensions were only used by a select few power users, if you don't count those installed by malware/shitware. Now it's common to see folks who only use their computers for Instagram and Youtube having all sorts of browser extensions installed intentionally, and use regularly. And they're essentially just bookmarklet/userscript bundles with access to some special extra APIs. What's more, with the proliferation of Electron in desktop applications, now even more of the UIs we use are programmable.
- vasergen 4y agoIs it because in the beginning of the web the percent of tech users was much higher than now and not revenue optimized?
- eloisant 4y agoPartly, but also because engineers had more powers. Now decisions are taken by managers or PO who don't care (or even know) about programmability, open standards, etc.
- throwawayjun21 4y agoI used hate ORMs and a few weeks ago i tried one just to improve my productivity and guess what i had to spend 2 days to figure out the problem that crashing my MySQL server. It turned out to be a ton prepared statements by the ORM. Simple web is better.
- nperez 4y agoUserscripts are alive and well! I use Tampermonkey in conjunction with an Amazon seller extension (which I won't name because I'm not really using it as intended). The extension displays, among other things, a flag icon next to a product listing indicating the seller's country. My script hides the extension's entire UI and replaces it with a country filter. It can be really useful to filter down to US sellers only, and only see brands that are well established here
- sylware 4y agoI miss the noscript/basic (x)html web.
- memorable 4y agoI used to write a lot of small user scripts because they allow me to easily add functionalities to a certain website without worrying about UI and shit like when building a browser extension.
- niklaslogren 4y agoI love the programmable web! I wanna give a shoutout to Stylus[0] for offering userstyles (basically the same thing as TamperMonkey but for .css files) [0] https://addons.mozilla.org/en-US/firefox/addon/styl-us/ https://addons.mozilla.org/en-US/firefox/addon/styl-us/
- f0e4c2f7 4y agoI think this is one of the highest aspirations of web3. API's baked in so deep that it's literally part of the protocol. Rate limited by price.
- zmix 4y agoI remember the goold ole' days, when XUL based Firefox could be programmed to act like a Shell to the WWW.
- islemaster 4y agoWhether they're gone or not, I definitely want _more_ of these. I've had great success with shared Tampermonkey scripts at work, augmenting off-the-shelf tools my team uses with conveniences specific to our team. For example, automatically extracting relevant bits within noisy logs when browsing CI results, or providing buttons that kick off narrow re-runs or link to relevant source files. CSS injections are great too, a very lightweight way to improve the accessibility and usability of tools.
- derefr 4y ago> 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 <script> 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 / CORS purposes, though.
- easrng 4y agoData URLs have a null origin and don't count as secure.
- ttepasse 4y agoMy 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.