4 ms·
I quite like bookmarklets, easy to write. Tried a userscript but couldn't get into it. Never tried an extension, wouldn't know where to start.
by account-5 3y ago
I quite like bookmarklets, easy to write. Tried a userscript but couldn't get into it. Never tried an extension, wouldn't know where to start.
- lstamour 3y agoStart with ChatGPT or a sample extension. The unfortunate part of web browser extensions is that, like the treadmill of web frameworks and app development, browsers can’t seem to stop changing and tweaking how extensions work and remove perfectly good functionality. So you end up sometimes having to rewrite an extension or its manifest with very little assistance from browser makers. But at least you don’t need to learn XUL any longer, so not all changes are bad ;-)
- notzane 3y agoI made this extension fully using chatGPT to diagnose some layout issues. It’s super simple but chatGPT was definitely useful setting up the chrome boilerplate (and commenting what each option meant). Make sure you ask it to target the most recent version, they recently changed (to v3?) and it seems chatGPT prefers writing for the old version. https://github.com/notzane/red-box-outline https://github.com/notzane/red-box-outline
- ustad 3y agoCheck out Firefox examples on github, you’ll like it, I’ve had great experience learning from them to add nifty features to my browser: https://github.com/mdn/webextensions-examples https://github.com/mdn/webextensions-examples
- olejorgenb 3y agoHow do you "compile" the bookmarklets? I know of https://bookmarkl.ink/ https://bookmarkl.ink/ but then we're back trusting some third-party service again. I get that it's not rocket science, but this is definitively a small hurdle to overcome.
- account-5 3y agoI don't compile them. I just write the JavaScript and wrap it in an anonymous function then save the code as a bookmark.
- olejorgenb 3y agoAh, I thought it didn't work to simply paste the javascript directly into the bookmark. Don't you have to minimally URI encode it? `javascript:URI_ENCODED_CODE`
- madacol 3y agoNo, Firefox automatically encodes it, but it does have other gotchas because line-breaks are removed - You have to put `;` on each statement - You cannot use inline comments, // you cannot do this