Personally, I still prefer the user style over Github's solution. I find the official black theme has too much contrast (it was probably made for amoled), and the bluish-black variant looks ugly to me. The user style has very good greys, and as a bonus, I've fallen in love with the cross-hatch pattern background it provides.
Most awesome userscripts in my experience are made for personal consumption. They are not distributed or documented. Some of the good ones I've made download so many pages from specific domains that it isn't sensible to share them. Some of them combine and implement ideas that could be made into bigger projects. Sharing those removes the opportunity.
But sometimes the tiniest tweaks are the best. Things like removing the points from HN so that it doesn't consume attention. Change "new" into "new threads" to make the link bigger. Hide logout. etc Perhaps one should release such one line scripts but I never did or see anyone do it.
I haven't updated it in 100 years but this was a fun concept.
bit of php, bunch of check boxes, out comes a site specific userscript (in this case wp) that hides all menu entries you don't want on a website.
One could offer it to the website audience. Lots of links need to be where they are but are never useful. If I for example need those in the HN footer (except from guidelines and list) I'm sure I can find them when the need arises.
I agree - I've been using (and writing) userscripts for an eternity. Most of them are public [1], but I don't know if others find them as useful. I like to enhance the design of websites I often use (like using a dark theme for HN), but those are rather subjective changes.
> Most awesome userscripts in my experience are made for personal consumption
Same with me. Some of my userscripts are very personal and you don't need to be compelled to share one just because you put a lot of time and effort into it.
Eh, it's very outdated. For example, "YouTube Plus" was sold by the author years ago (to shady party no less) and "Iridium" is his new endeavor on Y2B enhancement, which was also abandoned.
To be honest, I don't think there is any point to include specific scripts to begin with. https://greasyfork.org/ probably is a better place to find them.
Just list all the "meta" sites (toolings, host sites, articles) about userscript is probably better and easier.
On a side node, if anyone has resource about how to dev/debug userscript properly, I'm all ears. I found it super inconvenient and tedious when doing it myself, and I often have to manually copy paste stuff back and forth.
> On a side node, if anyone has resource about how to dev/debug userscript properly, I'm all ears. I found it super inconvenient and tedious when doing it myself, and I often have to manually copy paste stuff back and forth.
Agreed. Even stranger is that some errors end up in the console but others do not. Syntax errors particularly seem to fail silently.
If I'm putting together something that I know will be more than a dozen lines or so (or is targeting a page sitting behind logins and extra navigation) I will just save the target page as a local file and write the JS into that file and debug as normal until it's working, then copy the JS over to a userscript.
I don't know about syntax errors (I've seen them fail silently), however, at least with ViolentMonkey and Firefox, you can use an external editor for development and for debugging you can step through using the debugger.
> On a side node, if anyone has resource about how to dev/debug userscript properly, I'm all ears. I found it super inconvenient and tedious when doing it myself, and I often have to manually copy paste stuff back and forth.
Develop it as an extension with the script as your content_script, and use web-ext [1] to run it. You can then develop in your regular editor, use your browser's extension debugging tools, and web-ext will automatically reload it when you change stuff.
Most of my extensions use a .user.js file as their content_script, which I can also publish directly to Greasy Fork.
Man, userscripts were my ticket to software development (a frontend dev now). Sure, I did some really crappy programming before, but mostly as a part of education, not because I wanted to. Then I saw the Dollchan (or was it Govno?) and decided to make something like that for websites I frequented back then. Learned a programming language on my own for the first time, learned how to debug (Opera Dragonfly) and defineMagicFunction. In those small communities, people actually used my scripts. Recently a person contacted me because a ten years old script stopped working, asking to fix the issue. To this day, I routinely reach for Greasemonkey to solve web site annoyances, hosting the scripts in Gist for easy multi-browser compatibility and automatic updates. I hope userscripts don't ever go away.
I get you on the excitement of small communities and ha ING people use your scripts when beginning to program. One of my first programming experience was scripting for mIRC.
I started with BASIC and C in my teenage years, but mIRC scripting turned coding into a passion for me.
Some of my fondest memories is weekends spent chatting with friends and strangers on IRC, and improving my script or reading someone else's code in the downtime, and downloading mp3 in the background.
I recently found out AdGuard for Android allows you to inject user scripts on pages too, which is awesome. If you're a heavy user script user (heh), highly recommend you check it out.
Also, if you're a heavy vim user, and if you use tridactyl for Firefox, for some of the easier user script (e.g. simple redirects), you can use tridactyl, which might be cleaner. It's not as clean for larger scripts but it can work too.
Does any know if there‘s an extension for Safari that allows injecting site-specific CSS rules into pages? I know I could do this with a user stylesheet (but not site-specific) or Tampermonkey (but cumbersome via JavaScript).
Userscript run locally in your browser. They are getting injected in the tab when you load the website. Not sure what backend code of IFTTT is and whether this is the same.
> User scripts can improve your browsing experience, and open a lot of possibilities to make the sites you visit better by adding features, making them easier to use, or taking out the annoying bits.
These are like browser extensions. They don't run on a backend server, they run in your browser on certain pages, and can manipulate the contents of those pages.
I love user scripts. An interesting thing is that Amazon is powered by user scripts - when I was there I used and developed extensions to their atrocious internal ticketing system to make it better for me.
We worked on replacing the authentication layer on a set of APIs at some point, and the project got paused cause an entire group of amazonians was using a (non declared) user script and lost functionality when we started rolling out.
I wonder why this trend of fixing sites has gone down when the amount of annoyances is going up. Ad annoyances can be fixed by adblock and missing dark themes with dark reader but still, sometimes
a) the site is slow - so it's better to disable all js from the site and make couple lines of code to fix basic functionality
b) the site has some kind of BS behaviour that's not adblock related but still annoying - like super simple media players that are even worse than native browser ones (tiktok is a nice example)
Because the page source is more annoying, thanks to thinks like Vue and React, which generate the DOM on the browser, rather than building an actual web page on the server.
Take Twitter for example. The elements don't exist until the page loads, and none of the classes have any useful meaning, which makes user styles impossible, and user scripts need to rely on a DOM observer or a timer to find attributes or (even more often) element text to locate some elements to hide or modify.
I mean it's true that I've given up on twitter and I am just using one of the nitter instances, which works flawlessly
But there're also lots of news sites that aren't react or vue and they don't get any usercripts. Also I wonder if react and vue can be dealt with somehow so that I don't have to use special sites with custom frontend
32 comments
[ 6.8 ms ] story [ 85.4 ms ] threadPersonally, I still prefer the user style over Github's solution. I find the official black theme has too much contrast (it was probably made for amoled), and the bluish-black variant looks ugly to me. The user style has very good greys, and as a bonus, I've fallen in love with the cross-hatch pattern background it provides.
But sometimes the tiniest tweaks are the best. Things like removing the points from HN so that it doesn't consume attention. Change "new" into "new threads" to make the link bigger. Hide logout. etc Perhaps one should release such one line scripts but I never did or see anyone do it.
I haven't updated it in 100 years but this was a fun concept.
http://go-here.nl/gm/wikipedia-clean-up.php
bit of php, bunch of check boxes, out comes a site specific userscript (in this case wp) that hides all menu entries you don't want on a website.
One could offer it to the website audience. Lots of links need to be where they are but are never useful. If I for example need those in the HN footer (except from guidelines and list) I'm sure I can find them when the need arises.
[1] https://github.com/darekkay/config-files/tree/master/userscr...
Same with me. Some of my userscripts are very personal and you don't need to be compelled to share one just because you put a lot of time and effort into it.
To be honest, I don't think there is any point to include specific scripts to begin with. https://greasyfork.org/ probably is a better place to find them.
Just list all the "meta" sites (toolings, host sites, articles) about userscript is probably better and easier.
On a side node, if anyone has resource about how to dev/debug userscript properly, I'm all ears. I found it super inconvenient and tedious when doing it myself, and I often have to manually copy paste stuff back and forth.
Agreed. Even stranger is that some errors end up in the console but others do not. Syntax errors particularly seem to fail silently.
If I'm putting together something that I know will be more than a dozen lines or so (or is targeting a page sitting behind logins and extra navigation) I will just save the target page as a local file and write the JS into that file and debug as normal until it's working, then copy the JS over to a userscript.
// ==UserScript==
// @name HN test
// @version 1
// @grant none
// @include https://news.ycombinator.com/\\*
// ==/UserScript==
alert("hello"
shows nothing in a userscript, but:
Uncaught SyntaxError: missing ) after argument list test.htm:23
in a local page
Develop it as an extension with the script as your content_script, and use web-ext [1] to run it. You can then develop in your regular editor, use your browser's extension debugging tools, and web-ext will automatically reload it when you change stuff.
Most of my extensions use a .user.js file as their content_script, which I can also publish directly to Greasy Fork.
[1] https://github.com/mozilla/web-ext#web-ext
See eg. this config.
https://github.com/Ginden/userscripts/tree/master/hacker-new...
Then I do `npm run build && cat dist/index.ts | xclip` and replace code.
Some of my fondest memories is weekends spent chatting with friends and strangers on IRC, and improving my script or reading someone else's code in the downtime, and downloading mp3 in the background.
Would you please change the URL, @dang?
Also, if you're a heavy vim user, and if you use tridactyl for Firefox, for some of the easier user script (e.g. simple redirects), you can use tridactyl, which might be cleaner. It's not as clean for larger scripts but it can work too.
> User scripts can improve your browsing experience, and open a lot of possibilities to make the sites you visit better by adding features, making them easier to use, or taking out the annoying bits.
These are like browser extensions. They don't run on a backend server, they run in your browser on certain pages, and can manipulate the contents of those pages.
We worked on replacing the authentication layer on a set of APIs at some point, and the project got paused cause an entire group of amazonians was using a (non declared) user script and lost functionality when we started rolling out.
a) the site is slow - so it's better to disable all js from the site and make couple lines of code to fix basic functionality
b) the site has some kind of BS behaviour that's not adblock related but still annoying - like super simple media players that are even worse than native browser ones (tiktok is a nice example)
c) new site that has removed old features
Take Twitter for example. The elements don't exist until the page loads, and none of the classes have any useful meaning, which makes user styles impossible, and user scripts need to rely on a DOM observer or a timer to find attributes or (even more often) element text to locate some elements to hide or modify.
But there're also lots of news sites that aren't react or vue and they don't get any usercripts. Also I wonder if react and vue can be dealt with somehow so that I don't have to use special sites with custom frontend