3 ms·
Genuine question, where do I find out more information about where to go to learn how to write userscripts? Im able to write bookmarklets for simple stuff but I
by account-5 6y ago
Genuine question, where do I find out more information about where to go to learn how to write userscripts? Im able to write bookmarklets for simple stuff but I've never been able to find a good comprehensive guide about where to start with these. Im not a webdev and my JavaScript is basic at best.
- nicoburns 6y agoIt's very very similar to writing on-page JavaScript. Your script basically just gets injected into the page by the extension. So it's all the standard webdev stuff you'd want to learn: JavaScript, the DOM apis and CSS.
- bscphil 6y agoYep, these days 99% of the userscripts I write use no special permissions or APIs provided by the userscript manager, it's just pure JS injected into the page. The rare exception is when I need to do a GM.xmlHttpRequest for cross origin.
- toyg 6y agohttps://wiki.greasespot.net/Greasemonkey_Manual https://wiki.greasespot.net/Greasemonkey_Manual
- dastx 6y agoBetter yet, the Violentmonkey docs: https://violentmonkey.github.io/api https://violentmonkey.github.io/api
- jccalhoun 6y agoI'm a novice at Javascript but I managed to write a couple users ropes because I had specific goals. Then I spent a lot of time googling things and mostly finding things on stack exchange that seemed like they would work. A lot of times the code I found would use jquery but I didn't want to include that for my simple script so I would try to find an pure js way.
- ufmace 6y agoStart writing code in the browser console. It's a Javascript REPL with full access to the DOM for the site and the browser API. Once you put together a few lines that do something useful, paste them into a new userscript for the page and clean it up a little.