Live data from Hacker News

For your next side project, make a browser extension

geoffreylitt.com

231–240 of 286 posts

Re: For your next side project, make a browser extension

#231

If I want to build a cross platform browser extension is there an easier way then having to write it twice?

This _was_ easy the last time I created a new extension, as Firefox also supports the `chrome` namespace for extension APIs, but now that Chrome Web Store isn't accepting new Manifest V2 extensions, you'll at the very least have to have separate manifest files for MV2 and MV3 versions, and different implementations where relevant for MV2 and MV3 (depending on which features your extension needs - e.g. if your extension is really just a way to inject a content script into a page, you might just need separate manifest files).

Re: For your next side project, make a browser extension

#232
> making an extension is a fun and efficient way to create useful software, especially when you can only invest limited time and effort. Instead of starting from a blank slate, you can start by tailoring some piece of existing software to better serve your own needs

...and a quick way to get burned out due to churn from incompatible changes (either from websites or browsers) breaking your project.

What you're looking for may be modifying an existing Free Software project you use instead, which is something I wholeheartedly recommend. There's often a high chance that you'll be able to upstream your changes, making it better for everyone and taking ongoing maintenance out of your shoulders - unless you actually want to maintain it as your own, which is also something you're free to do.

Re: For your next side project, make a browser extension

#233
I love the section on "Earning the pixels", as this is something I also put a lot of time into in extensions, from the target site itself to the options page in my extensions having per-browser CSS to make sure it fits in with the browser's own options UI (and in light and dark mode).

With Twitter, earning the pixels in the site UI is even more fraught as it's a React Native for Web app, so you really don't want to touch the app's own DOM directly, as it will most likely get wiped out on the next render.

e.g. The latest version of Tweak New Twitter [0] keeps you on the "Following" timeline, gets rids of the new "For you" tab and adds a new "Retweets" tab - to highlight the Retweets tab as active when the user clicks it, I had to add a styling hook class to and use that to manually style the Retweet tab as active and override styles for existing tabs to make them display as inactive. Another layer of fun: at any point the user can change the Default/Dim/Lights out theme and the highlight colour using the Display dialogue, so I needed to figure out how to detect these changes, figure out what was now being used and re-apply them to custom UI on the fly.

[0] https://github.com/insin/tweak-new-twitter#tweak-new-twitter

Re: For your next side project, make a browser extension

#234

Last time I was making one (for myself, not to publish), my main issue was that browsers made it nearly unusable to have a private local extension because you only had two choices: - either upload it on their website and go through approval everytime - either lower security to run in developer mode, and have an alert warning you about it every X minutes, ruining your focus VSCode on the other hand has no issue runnin…

This is very intentional because it is common for malware to install browser extensions. It would be nice to have a way to opt-out but this is probably hard to do without also making it too easy for the malware to opt-out for you.

Re: For your next side project, make a browser extension

#235

Last time I was making one (for myself, not to publish), my main issue was that browsers made it nearly unusable to have a private local extension because you only had two choices: - either upload it on their website and go through approval everytime - either lower security to run in developer mode, and have an alert warning you about it every X minutes, ruining your focus VSCode on the other hand has no issue runnin…

AMO does not require a manual review nor the extension to be uploaded publicly. You can sign it through their site and then distribute it elsewhere.

Also, I don't see how you can compare browser extensions to vscode extensions. One product is aimed at your grandma, the other at software developers and doesn't have access to your email, banking and credit cards.

Re: For your next side project, make a browser extension

#236

Earlier quoted context omitted.

Chrome allows permanent side loading, and without signing, if one enables dev mode from extensions page. Firefox requires uploading to Mozilla for signing to side load permanently or host with them. Though you can self host once signed. IME Firefox add-ons are approved almost instantly if your addon is not minified or downloading code to execute outside the package. Chrome approvals are always days.

> Firefox requires uploading to Mozilla for signing to side load permanently Are you sure? I’ve been sideloading extensions, signed or not, into /usr/lib/firefox/browser/extensions/ and they’ve been working fine.

When was the last time you installed a new extension that way?

Re: For your next side project, make a browser extension

#237

I have already made one browser extension for easily adding bookmarks into the category (folder) you want to, or create a new subcategory while adding a bookmark. Try it out! peterhil/spellbook: Spellbook is a bookmark extension for Chrome and Firefox https://github.com/peterhil/spellbook

Awesome, this is exactly the kind of thing I was looking for. Will try it out later. I have a highly organized folder structure and this could be easier than finding it in the native treenav view.

Now I just need good ways to add and search tags, make offline copies (index.html+PDF), and maybe even search the contents of the pages and I'll be golden.

Re: For your next side project, make a browser extension

#238

Not sure if things have changed lately but as a user, I try to avoid browser extensions because they seem to be very insecure.

Imo, they definitely need more fine-grained permissions. (See other comments in this thread about that).

Re: For your next side project, make a browser extension

#239

I try to stay away from browser extensions as much as I can, it will only bloat my browser even further. Firefox + Tampermonkey should be enough in my case. Is there anything a browser extension can do that Tampermonkey cannot?

> Is there anything a browser extension can do that Tampermonkey cannot?

Tampermoney is an extension, so it can obviously do the same as others. But how much of this does it make accessible to the user scripts? Can you access the local file system? Other Servers? Can you modify the browser-interface itself? Context menu, toolbars, sidebar, add shortcuts, etc.? Can you save persistent data? And can you do all this at an elaborated level of quality?

Re: For your next side project, make a browser extension

#240
post #160

Earlier quoted context omitted.

Thanks, didn't know all that. I put in the "legalities" part mainly because I was thinking of a similar extension to defeat Elsevier & other vultures of scientific publication. Those people might be more litigious.

> defeat Elsevier & other vultures of scientific publication That’s a great way to have your life savings drained, or worse. Don’t do it if you live anywhere where you can be nabbed by Uncle Sam. See Aaron Swartz, Alexandra Elbakyan.

well, millions of people live somewhere that fit that description. surely someone’s done it? i dont have any personal use for it but i find it hard to believe “where you live” is any material barrier to free scientific information
Post reply on HN