Userscripts Are Fun and Are Still Very Much Relevant
dutzi.partyGiven the increasingly hostile nature of websites, along with the tendency to remove user control, userscripts are not just still relevant but more relevant than ever.
Here's some that I like:
https://greasyfork.org/en/scripts/10096-general-url-cleaner
https://greasyfork.org/fr/scripts/19210-google-direct-links-...
> https://greasyfork.org/en/scripts/10096-general-url-cleaner
Redirecting away from smile.amazon.com leaves a bad taste in my mouth.
That's not what that does. It makes it work for smile links. In any case, the code is there it can be changed.
Reading how many popular websites embed tracking in URL's leaves a bad taste in my mouth. I've been cleaning them by hand up 'till now.
Why use a userscript when you can use a search engine that is not from a spyware company? Like Startpage, Qwant, Duckduckgo or Searx? Alleluia, direct links out of the box.
For youtube, why not give Invidious a try (ok, it has its downs)?
Sometimes, the best solution to "hostile websites" is to not use them in the first place (or use their proxified versions).
That is such a useless and pervasive answer to something cool: why not use these alternatives. _Obviously_ the author/user of these scripts knows that the Internet has more than one thing for each kind, and obviously they chose to use the site they are using but in a different way.
None of the search engines are as good as Google (most of the time) and for video hosting sites it's about the content.
Imagine 20 years ago someone built a device that turns the volume down when ads come on, and the first reply to that is "but the channel I'm watching doesn't show ads". Well, good for you.
Sometimes the best solution to "I want to use this website differently" is to use it differently.
> for video hosting sites it's about the content
Invidious is an alternative front-end for YouTube--so you are getting the same content.
Ah, I did not know that, thank you for pointing it out.
> None of the search engines are as good as Google (most of the time)
Startpage (and ddg I think?) basically provide you googles search results without the tracking. They’re the same quality of results without your google created echo chamber (because google can’t profile your search habits when not using google directly for search)
You’re still giving google money (indirectly) but st least you’re depriving it of your personal data.
I wanted to love DDG. It promises a lot. And it delivers a lot. I love the shortcut codes.
But after a few months I had to go back to Google. Two main reasons:
1. Image searches could often return literally zero results for simple terms.
2. I'd look up a term and get non-English Wikipedia articles before the English ones, which often wouldn't even show up.
IMO it's not about "going back to" anywhere. It's not as if we couldn't use different search engines for different queries.
This all-or-nothing mentality of migrating away from Google (the search engine) seems flawed to me. It's still better for your privacy doing half of your queries using Google, instead of doing all of them.
By the way, no offense intended! We're all free to pick our tools.
I partly agree. I don't want it to be all or nothing. But the way browsers are set up with the "default search", it somwhat is.
Ooooh I would love to be able to custom route searches depending on rules.
DDG ends up working well as the default search for me. The ability to type my query and then decide if I want to use DDG or Google doesn't require me to take my hands of the keyboard. I just add a g! and I'm switched off my default. So it's a great default with an ergonomic way to switch to a different engine.
Google as default requires me to use the browser UX to change the engine, which I believe requires using the mouse or hitting tab or arrow keys. Less ergonomic.
Firefox supports this, go into Settings -> Search and set a keyword for the search engine.
For example, if you set the keyword for DuckDuckGo to "ddg" and Google to "go", then typing "ddg <your query>" into the topbar will search DuckDuckGo, and typing "go <your query>" will search Google.
DuckDuckGo itself supports this. Just start a query with !g to have it routed to Google. For example, "!g search on Google" would bring you to the Google search results page for "search on Google."
DuckDuckGo supports several other commands like this, which they refer to as "bangs."
The difference between the Firefox setting described by the GP and the DDG bang commands you mentioned is that the Firefox setting is close to zero latency since it’s handled by the browser. The bang commands need to go to DDG and then come back as a redirect, taking a few seconds more. On the other hand, the DDG bang commands work the same across other browsers too.
A query need not be started with a bang. Just add 'g!' or 'yt!' anywhere in your search terms and it should work fine.
Just as an aside, "bang" has long also been a term for "!" itself - hence the two characters starting shell scripts, "#!", being called "hashbang".
You can set a keyword for any bookmark. Firefox replaces %s with your query. Simply bookmark the search result page of any website, replace the query with %s and set the keyword for the bookmark.
Doesn't have to be search either. For instance, I use it for the nodejs docs, and npm packages too: "https://nodejs.org/api/%s.html" and "https://www.npmjs.com/package/%s". So I can type "node fs" open the fs docs for node, or "npm fs-extra" to look up the docs for "fs-extra" package on npm.
Even easier, Firefox has a right click menu option for form fields it think might be searches to add the search keyword directly.
I've set Firefox its default search engine to DDG. Then if the search results are unsatisfying, I search again but now prepend the search with !g for Google, or !gi for Google Images.
Fwiw, you don't need to prepend it; you can put it anywhere in the query
Oh really? Especially on mobile, that's useful to know, thanks!
> Non-English Wikipedia articles before the English ones
It was only recently that I discovered that each language’s version of Wikipedia is independently edited, rather than being a translated reflection of a canonical source material; and, therefore, that inevitably there will be “better” or “worse” versions of a page (i.e. more/less content, more/less fact-checking, etc.) depending on the language.
This gulf sometimes turns out to be so large, that it’s sometimes more informative to read a foreign-language Wikipedia article through machine-translation, rather than reading the one in your own language!
(I recall, in the recent HN discussion that linked to https://en.wikipedia.org/wiki/Musth, people were pointing out that the German-language article carried a lot more information than the English-language article. That specific discrepancy has probably been since fixed up care of HN readers themselves, but it was eye-opening, especially since the English-language version of the article was phrased in decisive terms like “scientists don’t know X” where the German article instead says “X is caused by Y” citing enough [German-language] studies to thoroughly prove its point.)
I wonder if DDG has just caught onto this trend, and is prioritizing the language of the article that has the most editorial activity. (It would actually be more work to do the opposite, now that I think about it—in raw PageRank terms, there’s always going to be a most-linked-to language-version of a Wikipedia article, and doing nothing means that that version simply floats to the top. Google et al must be doing extra work to group the “same” articles of different language-versions together, assigning them the PageRank of the highest-ranked one in the grouping, while rendering out the link+summary as that of the group-member corresponding to your own language.)
> I wonder if DDG has just caught onto this trend, and is prioritizing the language of the article that has the most editorial activity.
It should prioritize the language of the query. I'm supposing the commenter above searched for something in English and got a non-English result?
Yeah I was looking up some very straightforward things and I'd end up with non-English wiki pages on the first page, and the English wiki page for the same topic was... I guess maybe on later pages.
Are you using a VPN? I've never seen a foreign language wiki article show up, and I've been using DDG for a couple of years.
Oh my. You know what. I might have been on a VPN.
A killer feature on Hackernews would be the ability to just point to a common thread like wiki that people could update; so we don't have to scroll through the comments on how people love DDG, but it just doesn't have good results. So instead of every post having a huge comment section on this restating the entire thing over and over and over, we could just link to the wiki that has the discussion on duck duck go.
It's pretty easy to append "!g" to your ddg search results if they're inadequate.
Yeah, this is so engrained in me now, I find it hard to search without a "second opinion" on devices that default to just Google.
For me the quality of DDG search results seems to fluctuate over time. In the recent times it’s become worse, and I’ve resorted to going directly to !s (startpage) or !g (google). I take many other precautions in my browsing to thwart tracking anyway.
Translation: you prioritized convenience over privacy.
That's your choice to make and I'm not criticizing your choice, but I do think it's a bit off-base to criticize DDG for this. There's a pretty inherent tradeoff: violating privacy is should allow Google to produce better, more personalized search results if they are at all competent.
I would guess that the vast majority of DDG users don't use DDG because they think it produces better search results. We're using DDG because we're concerned about our own privacy and/or the implications of letting a corporation gather very personal data on every person in our society.
I tried my best to switch to DDG this year. The results just aren't as good as Google.
I'd like to offer a less binary perspective...
I tried to switch and ended up using both, I use duckduckgo not for privacy but practical reasons: recently google has become extremely irritating for technical searches that are not popular, even for the ones it can find it now autocorrects them by default to "what it thinks you meant", which for technical things like parameter names, command names, APIs etc are always wrong, even though the whole search phrase is extremely descriptive and matchable.
I found that DDG is good for these types of searches (esoteric technical search that might be clobbered by googles dumb "AI" autocorrect or SEO optimization / I cant tell if it's an ad anymore BS that slows you right down), for these you get the result immediately and with one click... but DDG is worse for popular things where the search phrase is less descriptive and more associative.
So now - I use both, DDG by default because it's faster to get to the result with less shit in the way; then back to google for the few popular things...
I think this isn't too bad of a deal for privacy either, everyone assumes you must completely switch a service, but if you only search popular things on google, then you will look just like everyone else, you starve them of specificity.
>SEO optimization
Search engine optimization optimization
Startpage: "You can’t beat Google when it comes to online search. So we’re paying them to use their brilliant search results in order to remove all trackers and logs."
Searx is a meta search engine. You can gather results from gogle.
RE Startpage, sounds good, seems to work... how are they making money to pay Google?
Startpage also shows ads at the top of the search results. It claims not to track the user (similar to DDG, which also shows ads but doesn’t track the user). But there was news about Startpage being acquired a few months ago, and the trust in it has dropped for some people.
They show ads at the top of every search I've ever done there. At least when I'm not using an ad blocker.
I find that it varies by query, and often dry will give better results. Especially if I am looking for something more than a few weeks old, or off the beaten path.
Google will often replace or ignore words in my query and return garbage.
> We could create a browser extension, but that means developing one for all major browsers.
Personally, I use most of the extensions I've written in userscript form via Greasemonkey for the convenience of being able to drop straight into editing and testing it when I spot something which could be added or needs to be fixed.
If your userscript doesn't depend on any APIs provided by the userscript manager you're using, you can package it up as a WebExtension by adding a manifest.json:
{
"manifest_version": 2,
"name": "Your Userscript",
"version": "1.0",
"content_scripts": [
{
"matches": [
"https://example.com/*",
],
"js": [
"./your-userscript.user.js"
]
}
]
}
Once you've dropped a manifest.json in, web-ext [1] is handy for running extensions in Firefox and Chrome in a temporary profile/developer mode. It also reloads the extension when you make changes.This is particularly useful if your script grows to the point where it could benefit from an options screen, as you can configure `"options_ui": {"page": "options.html"}` instead of having to hack an options UI into the target site yourself.
I thought web-ext was only for Firefox, and I didn't see anything in the Readme about Chrome?
Looks like it's only in the release notes [1] - I only spotted it recently myself while updating an extension, it's:
[1] https://github.com/mozilla/web-ext/releasesweb-ext run --target chromiumThank you!
I’ve been really into using scripts to enhance my browsing experience, so much so that I’ve spent the last 6+ months developing these extensions to curate my experience on the Web:
- Intention (https://getintention.com) - Pauses distractions so I can scroll less and do more
- Hide Feed (https://hidefeed.com) - Replaces feeds with my daily focus
- Hide Likes (https://hidelikes.com) - Hides vanity metrics for a more authentic experience online
They’ve made a significant difference to my browsing experience —- give them a try!
I’m using one to speed up YouTube videos by 2 by default [1], which saves me quite some time.
I like Hide Likes, I've done similar things with Stylus on some sites (e.g. HN where I hide the points of my own comments).
Tampermonkey, ViolentMonkey and GreaseMonkey are all available in Firefox.
Can anyone provide a comparison?
Edit for the early commenters: as I stated, all of the above are available on current Firefox. Greasemonkey also has been ported to webextensions. Hence my question.
Edit 2:
TamperMonkey is closed source source and apparently embeds Google Analytics. Either of those immediately kill it for me, considering the kind of access the addon gets.
ViolentMonkey "does not collect user data at the moment", but also allows for it in the privacy policy.
I think I'll stick with GreaseMonkey.
Here's a short relevant Reddit thread:
https://www.reddit.com/r/firefox/comments/9uemks/greasemonke...
Though I wrote Greasemonkey originally, I have no idea regarding the answer to this question. What I can say is that Anthony Lieuallen is a super standup guy, which is why I handed it over to him and Johan way back. Based on that alone, I personally continue to use GM whenever I have a need.
Thanks! GreaseMonkey was so crucial back during my Ingress days!
Thanks Aaron!
GreaseMonkey is still pure open source, MIT licensed. For a while we had some general telemetry built in, but that was back in the 3.x days, so not for over two years now.
Even an MIT licensed extension can be changed on a whim and pushed through update - and browsers make it deliberately inconvenient to run a local extension checkout long-term.
I have a chip on my shoulder here, because i was the victim of when the de-facto analogous extension for CSS, Stylish, silently changed ownership and violated my privacy without ever prompting me to accept any new ToS.
No userscript or extension has ever seemed sufficiently interesting for me to risk that ever happening again,
(PSA: Make sure you do not have Stylish installed.)
And, if you're looking for a Stylish alternative, pick up Stylus: https://addons.mozilla.org/en-US/firefox/addon/styl-us/
This is why my extensions are limited to highly trusted and highly essential ones like ublock. I just can't trust extensions to be good now and good forever after. Its way to tempting for an extension developer to sell it on to an ad corp.
uBlock is not highly trusted. You are looking for uBlock Origin.
This is a real life case of "why should I have to chanher my name? He's the one that sucks!" I wish gorhill would get over it and change the name so naive users stop getting victimized by uBlock.
> ViolentMonkey "does not collect user data at the moment", but also allows for it in the privacy policy.
That reddit thread is outdated. ViolentMonkey's actual privacy policy unambiguously states that they do not collect any user data.
> "does not collect user data at the moment"
There are limited record of edit history of ViolendMonkey's privacy policy [0] that I can locate, so don't know if it's true in the past, but I don't see this statement in ViolentMonkey privacy policy now [1].
[0] https://github.com/violentmonkey/violentmonkey.github.io/com... [1] https://violentmonkey.github.io/privacy/
One difference: Tampermonkey is closed source while ViolentMonkey and Greasemonkey are MIT licensed.
I've stuck with Greasemonkey myself too. My reason is a bit more esoteric -- I use a user script which adds a dicebear.io/adorable.io avatars based on usernames on HN (I find it easier to remember commenters by the avatar/username combo rather than just username), and Greasemonkey seems to have been the only one out of the three to successfully bypass HN's CSP rules and show the actual hotlinked images.
Can you please name or link the avatar script? Search fu is failing me.
I think when Firefox moved to WebExtensions and GreaseMonkey was too late to adapt their code, TamperMonkey had quickly made the switch supporting the full GM API and more. I had seen after a while and GM had become even more limiting in terms of what you could do, so I just made the switch to TamperMonkey. Didn't notice the privacy policy so far, will have to re-evaluate my options now.
I am an author of many userscripts, and I personally tell my script users to switch from GreasyMonkey when they have problem using my script. The reason is GM inject the script a little bit differently since GM 4 was released, which breaks some hooking techniques so script will break.
As for myself, I use ViolentMonkey because it is more reliable (compared to GM) and open source.
I use Violentmonkey because unlike Tampermonkey, it’s open source, and unlike Greasemonkey, it supports old user scripts that use the synchronous `GM_…` functions such as `GM_getValue` and `GM_setValue`.
Greasemonkey 4, released in 2017, introduced a new asynchronous API `GM.…` (e.g. `GM.getValue`), and dropped support for the equivalent synchronous `GM_…` functions: https://www.greasespot.net/2017/09/greasemonkey-4-for-script.... There also used to be some functions such as `GM_registerMenuCommand` that Greasemonkey 4 provided no equivalent to. However, it looks like Greasemonkey’s polyfill (https://github.com/greasemonkey/gm4-polyfill) has expanded its support for the old `GM_…` functions since I last checked, so maybe migrating old scripts I use to Greasemonkey 4’s new API won’t be as difficult and limiting as the last time I considered it. I probably won’t bother unless I have a reason to switch away from Violentmonkey, though.
The user script I use that still uses the old APIs is Webcomic Reader, if you’re wondering. It preloads previous and next comics to speed up browsing, and restyles sites to show hidden per-comic bonuses like title text. It’s at https://github.com/anka-213/webcomic_reader, and its issue about potential Greasemonkey migration is at https://github.com/anka-213/webcomic_reader/issues/130.
As you noted, TM is closed-source. However, GM is very sparsely developed after the switch to webextensions—still no script management interface, as far as I can see. TM whips it in terms of features. VM appeared recently in the FF land, and my guess is, it's for those who hope for faster development—however dunno if those hopes are realized, feature-wise.
> dunno if those hopes are realized, feature-wise
Violentmonkey has all the features I need. I don’t know what features Tampermonkey has, but I can’t think of much more I could ask for in Violentmonkey. VM has:
• A dashboard page where you can remove, disable, or update user scripts.
• A CodeMirror editor with syntax highlighting for editing installed scripts.
• A ‘+’ button to create a new script for the current site.
• Support for scripts that use the GM_… functions like `GM_setValue` and `GM_registerMenuCommand`.
• Site-specific actions in the extension menu: enable or disable scripts for this site, run those scripts’ menu commands, or search Greasy Fork for published scripts that apply to this site.
I only use extensions that don't have minimized/obfuscated code in the xpi file. So that leaves only GreaseMonkey. There's zero technical reason to minimize extension JS code, since it's already compressed in xpi (zip) file.
It's not a silver bullet (I caught people who managed to put a tracker into non-minimized code too, in the past.), but minimized code is hard to compare for chnages and review during updates, so that's a no no for me.
Usage stats from Mozilla AMO:
ViolentMonkey: 50K TamperMonkey: 418K GreaseMonkey: 478K
VM appeared quite recently, compared to the other two. Its usage has been growing for some time, but dunno about the last months. My guess is, it's a fresh open-source option for those who don't like the current glacial-rate development of GM—but not sure how it is in terms of features.
GreaseMonkey is the "legacy" option. ViolentMonkey runs on Chrome. TamperMonkey runs on Firefox.
Both you and the article recommend not to run ViolentMonkey on Firefox. Why?
I think it's stale info -- ViolentMonkey used to be unavailable on Firefox.
From tfa: “you simply install ViolentMonkey (on Chrome, use TamperMonkey for other browsers)”
Greasemonkey is old news.
Strongly agree with the original article, and it's fun to see all the niche use cases that people are mentioning here.
But I have a major frustration with user scripts: writing them requires experience with Javascript and reverse engineering websites. This is fine for the HN crowd, but locks out most web users, who can't program at all.
I bet that if it were slightly easier to develop user scripts, there'd be 10x as many of them. I'm sure I'm not the only one who's helped a coworker write a bookmarklet / user script essential for their workplace sanity.
Would be curious what people's experiences have been helping nontechnical people extend websites, or if you know of tools in this area.
My current attempt at this is a project called Wildcard, which requires a programmer to write some site-specific scraping code, but then shows the scraped data to the end user in a spreadsheet and lets them decide what to do with it:
Would be nice if every website had a scraper. People maintain huge content blocking databases so why not scraping code? It should be possible to treat every website like an API.
Many years ago there was a browser plugin out of MIT called "piggy bank". It included a browser for exploring RDF data (longwell), and the ability to define scrapers of RDF data on a per-site basis. (I think it was javascript and tagged with the hostname of the site, but it's been a while.) It stored stuff locally, but could also upload to a server hosted longwell instance.
Every now and then I wish I still had something like that, but the team has long since moved on and it's bit-rotted a bit.
More recently, I've found that a lot of recipe web sites have been embedding the recipe as json-ld data (I presume to appease Google), so I've written a grease-monkey script to collect those as I browse and post to a personal couchdb instance. I haven't gotten around to putting a UI on that or further processing the data yet (e.g. I need some agents to fetch images or pull them from browser cache), too many irons in the fire, but maybe someday.
Userscripts are great. I'm using it mainly for adjusting page styles (similar to Stylish[1]). I'm reading this very HN page in my custom dark mode. But I've also created some behavior-altering or automation scripts, some of them being open-source [2]. Adding a "@downloadURL" attribute makes it possible to sync the scripts easily across all devices (and users). Userscripts was also my main reason for switching to Firefox, because the mobile version supports Addons.
[2] https://github.com/darekkay/config-files/tree/master/userscr...
15 years ago i used userscripts for ... kinda cheating at a popular browser game. i didn't do anything _really_ illegal, it just extended the UI.
e.g. if you sent an army to rob a village, it stored the type and level of workshops and calculated how many troops you'd have to send plundering the next time.
it worked really well. next i changed the backend from local storage to a shared database and shared the script with a few friends from my clan. that kinda broke the game. we were incredibly successful but i also immediately lost interest, quit the game and killed the server.
I did same for ogame! I can't remember exact details but I could queue stuff the game wouldn't let me. some were paid features i think
In a similar vein: https://code.tutsplus.com/tutorials/how-to-build-a-python-bo...
Sounds like tribal wars or travian ;)
Funnily enough, one of my first GreaseMonkey scripts that I wrote 9 years ago was one that added the ability to collapse threads here on HackerNews [0]; this functionality was finally added in the past year or so to HN (not based on my implementation).
Worked like a charm back in the days :)
Another more popular GreaseMonkey script of mine was the Wikipedia TeX Source Extractor [1]; I used it extensively during my studies when writing lecture summaries, papers, or my thesis.
Userscripts are definitely fun and can be quite useful.
[0] https://github.com/giu/hacker-news-threadify
[1] https://github.com/giu/wikipedia-tex-source-extractor
Update: After not having touched the code of [1] for over 8 years, I just updated the userscript to work with Firefox 75.0 and the GreaseMoneky add-on v4.9.
[I posted this as a "Show HN" a few days ago [0]]
I wrote a short JavaScript snippet to export HN Favorites to a CSV file. It scrapes the HTML and navigates from page to page.
Setup and usage instructions are in the file.
Check out https://gabrielsroka.github.io/getHNFavorites.js or to view the source code, see https://github.com/gabrielsroka/gabrielsroka.github.io/blob/...
MediaWiki (the software that runs Wikipedia) has extensive built-in support for user scripts. There's a decent number of them, too, used for everything from automation of batch tasks to adding any feature one could ask for to the interface. I've written a few myself. Actually, the first programs I ever wrote that other people really used were user scripts. I remember live-debugging one with several users in my ear via TeamSpeak once. "Working yet?" "Nope." "Nah."
The company I work for basically relies on use scripts to make any of our internal tools usable. Its kind of insane and makes on-boarding new employees somewhat difficult when they aren't even looking at the same UI as tenured people.
You could create a basic profile for Firefox and load it on their computers. That would solve the issue of different UI’s initially and on-boarding would be easier.
I use daily at least 3 Firefox profiles - Plain, Work, Personal
I have others specific to clients. Firefox containers are an option now (although my setup predates this). This still allows extensions and everything to be encapsulated.
> I have others specific to clients. Firefox containers are an option now (although my setup predates this). This still allows extensions and everything to be encapsulated.
Thanks for pointing this out, i was thinking about this but lazy enough to postpone research. Now i know
Look at the LTS versions of firefox (plug for my favorite browser). However similar is available for Chrome and shouldn't take more than a day to test and deploy for a small-medium office by any competent IT person.
Here is the one I advertise the most
https://greasyfork.org/en/scripts/811-resize-yt-to-window-si...
https://github.com/Zren/ResizeYoutubePlayerToWindowSize/
The only thing that would irk would some, I think, is that any stats/details are out of sight, a scroll/pgdn away
Highlight new comment on HN
https://greasyfork.org/en/scripts/18066-hn-comment-trees
For reddit:
https://github.com/Farow/userscripts/blob/master/reddit-high...
Gmail android creator had a unified one for HN+reddit that syncs across sessions, but it lacks features and haven't been updates in years:
https://chrome.google.com/webstore/detail/new-comments/jldpf...
My most used bookmarklets increments playback speed for html5 videos, i have one that +0.5x and one that -0.5x
javascript:(function() {var media = document.querySelectorAll('video,audio'); var rate = media[0].playbackRate+0.5; Array.prototype.forEach.call(media, function(player) {if (rate == null) {return;} else if (rate != 0) { player.playbackRate = rate; } else {player.playbackRate = 1;}}); })();
Also skip forward / back 30s
javascript:(function() {var media = document.querySelectorAll('video,audio')[0];media.currentTime = media.currentTime+29;})();
Forgot:
Great great for skipping past ads or blocks of content based on visual timeline. Wish this was in more in native media players.
For HN I prefer this one: https://github.com/andreicristianpetcu/HNMarkAllRead/release...
(chrome one is in the store)
It marks comments or posts as "read" (or "seen") for a whole page and than hides them. And you can tell it not to hide posts where you "subscribed" to the comments.
I can never go back, so tired of skimming over the same top posts all day again and again.
I think it also does tree comments.
I have severe photosensitivity; large blocks of white hurt my eyes. I use userscripts with Tampermonkey to change sites like this one and Github to a dark color theme that my eyes will tolerate much better.
I think I might have the same thing tough if I reduce temperature I can tolerate white allright. It actually removes all the blues and starts to look pinkish. I use the f.lux app with a slight color temperature reduction at all times. Sometimes I accidentally turn it off and what a difference on my eyes!
Your OS might be able to “reduce white point” everywhere or you can replicate it via color profile.
This is how Hacker News looks like with my script: https://i.imgur.com/We97pJC.png
Numbers on the left (11, 12, 13) are shortcuts to open a thread (for example, pressing 14 opens the "Userscripts are fun..." thread).
Numbers after that (e.g. 65,20) are karma and number of comments, respectively.
Much more compact than the default layout and shows better which topics are hot.
Is it available somewhere? I really liked it!
Recently wrote a userscript to sync video progress with my friend via peerjs. Works like a charm. And it supports any <video>. The edit-reload dev experience is still much better than extensions.
I recently wrote a tiny alternative to the mentioned webpack plugin https://github.com/nfour/TinyWebpackUserscriptPlugin
Using it in this project with some userscripts (see webpack.config.ts): https://github.com/nfour/userscripts
Tampermonkey seems like the best script manager for developer experience (as far as I could tell from trying the others) when configured as recommended (removing cache checks etc.), though it still requires 2 page refreshes to show changes.
If anyone knows of an improved workflow I'm all ears. I'd like to see something closer to webpack hot reloading, though I suspect we either need a new script manager, or a userscript framework that can be configured to hotswap code.
Perhaps browser managed content scripts will be viable? https://github.com/violentmonkey/violentmonkey/issues/604
web-ext does hot swap, see the sibling comment from insin to get a minimal manifest for a userscript.
I made this bookmarklet for Mixcloud to be able to save the current track to my YouTube playlist.
javascript:window.open('http://google.com/search?q=' + [].slice.call(document.querySelectorAll('span[class*=TrackInfo]')).reduce((acc,el)=>acc + el.innerText.split(' —')[0] + ' ', '').trim())> Nowadays the internet is pretty decent for all
... what? The web is rapidly becoming more and more unusable. Often, sites only work well when I fully disable JavaScript, and the associated autoplay ads, trackers, custom half broken and CPU intensive navigation behavior overrides, and similar sources of misbehavior.
The modern web is more user hostile than ever before.
I agree that the web is a bunch of potholes with autoplay sound and video, pop ups, in your face ads, etc. I find an adblocker, turning off autoplay in firefox, and pi-hole fix 99% of that. So I don't think you can say "often" that you have to fix things, unless you refuse to use similar methods that I've used. Literally the only site I will jump through hoops for and turn things off for (whitelist) is my bank, and they don't have anything other than a couple of annoying popups.
> I find an adblocker, turning off autoplay in firefox, and pi-hole fix 99% of that.
I find that turning off JavaScript works even better. Ad blockers don't generally disable JavaScript that tries to change how, for example, scrolling works.
My main use case for user scripts is to automatically authenticate on brain dead corporate sites. webex is one example where you cannot save name/password in the browser per default.
Yeah, as a developer I still use userscripts and also create them sometimes. Just some days ago I updated my Wikipedia Flag Icons e I recently created a super simple one to sort Linkedin feed chronologically by default. Both are open source and available as extensions too:
- https://github.com/DavideViolante/Wikipedia-Flag-Icons
- https://github.com/DavideViolante/Linkedin-Feed-Sort-By-Rece...
Are userscripts still run once after page load? That was a major pain point last time I tried using them, on a dynamic page. I tried hooking some events and run-registered-function-on-tree-change-but-at-most-at-N-msec-intervals, but it got out of hand and ended up looking to take much more time to write than the handler it was going to call, so I filed it under "should be written once and properly" and postponed the whole thing.
MutationObserver should do the trick if you can pick elements which consistently change at times you'd want to re-run. Watching for <title> changes tends to be good for single page apps.
I block cookies (and some other stuff) on YouTube, which also causes all of my settings to fall back to the most annoying defaults possible. So I use a combination of userscripts and userstyles to batter the YouTube client until it does what I want (i.e. a dark theme by default, auto-pausing of channel trailers, a sane default volume and a few other things). It's pretty amazing how powerful userscripts and -styles are!
I installed TamperMonkey recently and wrote some scripts to improve my Twitter experience. Very handy. Then it popped up a request for donations screen, which is an understandable approach by the TamperMonkey author, but I became uncomfortable that TamperMonkey was watching everything I did on the web and reporting back to the author, so I uninstalled it.
I saw the same request and it was the trigger for me to donate.
I would have to had the author said something along the lines of "I don't track your browsing history"
One of my favorite browser extensions, Simplify [0], started its life as a userscript/userstyle.
I've used Greasemonkey scripts to fix stupid (and in one case, broken) things on mandatory intranet sites. They're invaluable.
For me, userscripts have been a great way to learn javascript. I have no programming experience and the ability to find something I want to tweak and be able to implement it on a web site is pretty cool. I created a userscript a few years ago and during the quarantine I've been learning a lot rewriting it to work better.
I've spent 9 years maintaining a userscript for a website that now has a new beta in React. Boy, is that a pain in the behind comparatively. I'm pretty sure what I'm doing on the old version of the site won't be possible, but that is yet to be determined.
You may want to check out Social Fixer (socialfixer.com). It's a userscript that manipulates and adds features to Facebook, which is written in React. You may get some ideas from them.
I am surprised by the fact that my userscript (Local YouTube Downloader) is mentioned. Thanks!
I’ve written extensive user scripts to improve inferior web interfaces of tools that we use for work. My two biggest ones are for a work tracker and a support system. The support system one especially is considered indispensable by the support staff and almost everyone else that ever interacts with it. (Why not just change support system?—you may ask. There were certain features that provided the concrete reason for staying with that one. And in bigger businesses you often don’t have the flexibility to choose different things anyway.)
A fair fraction of the user scripting is actually just stylesheets, and indeed I started out with just user stylesheets. It’s amazing what you can do with such stylesheets. You can reduce borders, margin and spacing, reorder sections with flexbox and/or grid layout, hide irrelevant functionality or data fields that you never use but the tool doesn’t let you hide, emphasise details that are important to you, reduce the need for scrolling (more efficient layout is routinely able to make things 30–50% shorter without feeling in any way cramped, because many layouts are simply unnecessarily wasteful of space), make sidebars sticky to save scrolling, increase the size of elements and popups that are inexplicably small with forced scrolling, and loads more.
And that’s just the styles part. Add scripting and you can do things like set the document title because the system just sets “AppName” or “Manage Request”; automatically click on “load more” links; restructure content for better consumption; in history streams collapse automated things with a single line summary, or bulky tables of the fields that changed with more compact representation; highlight things differently based on the result of some function on the element (e.g. who wrote it), change how times are presented (e.g. replace an absolute timestamp with absolute and relative, plus showing other timezones that could be relevant in a tooltip); add a button to copy the ID or link for an item; and much more that I haven’t even thought of yet.
My user scripts are readily configurable: each feature can be turned on or off independently, since a few of the features some people like and others don’t.
I’ve thought and said before that this should be a plausible business: forced to use a web app that’s slowing you down? Hire me and I’ll make it easier and faster for you to use. I guarantee improved happiness and at least some productivity boost, and enormous productivity boosts are possible, like orders of magnitude in some cases, by better information presentation and automating arduous human-driven tasks.
There’s always the danger that the app will change underneath you, but this isn’t often a problem.
If you’re interested in this idea and have any web apps that you might like help with making a user script to improve, email me at userscripts@chrismorgan.info.
I built a bunch of tools with user scripts to help run a smallish ecommerce business. It was especially useful because they didn't have the ability to easily or inexpensively make changes to their platform (you could argue that this is a big issue, but a lot of merchants have to give up control as the alternative is prohibitively expensive).
- A internal "there's an issue with this product" feature that created a ticket for the content team
- Identifying products and creating a Google Charts sparkline with sales inline on product listing pages
- Showing sales stats inline in pages, allowing non-technical people to get useful insights by just browsing the site and not having to look at dashboards/reporting tools/etc
Since 2012 I'm using a userscript I wrote to inject a button to each github code comment to open my editor at the file-and-line.
It feels strange this is not something more people want, but I haven't seen any other project that addresses the same, so I'm still kinda maintaining it:
> We could create a browser extension, but that means developing one for all major browsers.
No it doesn't. A single webextension works across Firefox, Edge and Chrome. Safari is an exception though.
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/Web...
How about pushing for browsers to allow for the same functionality browser wide? And, yes, I am still bitter about firefox killing vimperator.
So the last time I tried to make an extension (I believe in chrome) for an application I work on, I could not access data stored in the global object - I was trying to make data available to the extension to do more with and show like debug information. Can you access js variables with userscripts like you could in the developer console?
I can't believe that cut-n-paste can be modified by websites and it isn't easy to regain control. For some sites, when you copy a text selection it adds the url as well.
I really wish you could tell your browser to disallow this kind of modification. I only want to copy what i see with my eyes. (WYSISYG)
As someone who has made a number of userscripts to improve his experience with various websites (mostly for work), I'm glad they're getting some attention :)
So often simple UI changes like resizing a textbox or adding the ability to collapse comment threads can make a big difference to your experience.
I wish there were a userscript equivalent for API's. e.g. someone could make and share a script to get flight details from the Gmail API. The advantage would be that I could run the script rather than give an oauth token to a third party to run it on my behalf.
What's the security story for userscripts?
Most are short at least, if you know js you can actually skim for blobs, URLs or obfuscation (blobs or URLs can be legitimate, just without them I feel quite safe right away).
Feels way safer than installing an add-on from the store, but of course just for me as a programmer.
On the user's side: Treat userscripts like stuff you paste in the browser console.
In terms of actual tech: GreaseMonkey (and probably also Tamper-/ViolentMonkey) does some sort or isolation between the userscript and the page so that the page can't hijack the userscript. More on that here: https://wiki.greasespot.net/UnsafeWindow
If somebody could tell me how to use user scripts and user CSS on Brave mobile, I'd be a happy person.
Contrary to the suggested browser Kiwi which is discontinued I'd suggest Yandex browser in android which supports extensions.
Discontinued? It's fully open sourced:
Brave mobile doesn't allow extensions/addons, so your only bet on Android is Firefox. If you're on iOS, IIRC Firefox on iOS doesn't support extensions, so tough luck ;_;
Kiwi browser has full extension support. Firefox for android is scheduled to drop support for all extensions except ONE. And add them back with time.
Thus I've not updated mine in weeks. So I don't know the status of the version on play store.
If you're on Android, then switch to Kiwi Browser which allows extensions.