Live data from Hacker News

Userscripts Are Fun and Are Still Very Much Relevant

dutzi.party

131–140 of 145 posts

Re: Userscripts Are Fun and Are Still Very Much Relevant

#131
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)

Re: Userscripts Are Fun and Are Still Very Much Relevant

#132

Earlier quoted context omitted.

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.

Re: Userscripts Are Fun and Are Still Very Much Relevant

#133
post #88

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…

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.

Re: Userscripts Are Fun and Are Still Very Much Relevant

#134
post #91
post #76

Earlier quoted context omitted.

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 " into the topbar will search DuckDuckGo, and typing "go " will search Google.

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 nod…

Even easier, Firefox has a right click menu option for form fields it think might be searches to add the search keyword directly.

Re: Userscripts Are Fun and Are Still Very Much Relevant

#135

Earlier quoted context omitted.

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!

Re: Userscripts Are Fun and Are Still Very Much Relevant

#136

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.

Re: Userscripts Are Fun and Are Still Very Much Relevant

#137
post #53

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…

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.

Re: Userscripts Are Fun and Are Still Very Much Relevant

#139
post #16

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:

https://github.com/kiwibrowser/src#timeline

Re: Userscripts Are Fun and Are Still Very Much Relevant

#140
post #2

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 k…

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.

Post reply on HN