Here's some that I like:
https://greasyfork.org/en/scripts/10096-general-url-cleaner
https://greasyfork.org/fr/scripts/19210-google-direct-links-...
Redirecting away from smile.amazon.com leaves a bad taste in my mouth.
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).
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.
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.
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.
web-ext run --target chromium
[1] https://github.com/mozilla/web-ext/releases- 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!
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.
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.
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.
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.)
That reddit thread is outdated. ViolentMonkey's actual privacy policy unambiguously states that they do not collect any user data.
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/
As for myself, I use ViolentMonkey because it is more reliable (compared to GM) and open source.
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.
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.
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.
ViolentMonkey: 50K TamperMonkey: 418K GreaseMonkey: 478K
Greasemonkey is old news.
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:
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.
[2] https://github.com/darekkay/config-files/tree/master/userscr...
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.
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 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/...
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.
Thanks for pointing this out, i was thinking about this but lazy enough to postpone research. Now i know
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
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.
(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.
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.
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
javascript:window.open('http://google.com/search?q=' + [].slice.call(document.querySelectorAll('span[class*=TrackInfo]')).reduce((acc,el)=>acc + el.innerText.split(' —')[0] + ' ', '').trim())... 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 find that turning off JavaScript works even better. Ad blockers don't generally disable JavaScript that tries to change how, for example, scrolling works.
- https://github.com/DavideViolante/Wikipedia-Flag-Icons
- https://github.com/DavideViolante/Linkedin-Feed-Sort-By-Rece...
I've used Greasemonkey scripts to fix stupid (and in one case, broken) things on mandatory intranet sites. They're invaluable.
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.
- 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
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:
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...
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)
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.
Feels way safer than installing an add-on from the store, but of course just for me as a programmer.
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
Thus I've not updated mine in weeks. So I don't know the status of the version on play store.