4 ms·
Browser extensions. Not quite a website, not quite a mobile app, and surprisingly pervasive. Most people don't realize how incredibly powerful they are, even wi
by mfrisbie 4y ago
Browser extensions. Not quite a website, not quite a mobile app, and surprisingly pervasive. Most people don't realize how incredibly powerful they are, even with manifest v3.
I almost fell out of my chair when I found out there were no books on how to build them, so I wrote one: https://www.buildingbrowserextensions.com/ https://www.buildingbrowserextensions.com/ It was incredibly enjoyable to go through the APIs and write about all the different crazy things they can do, and I put the best ones into a demo extension: https://chrome.google.com/webstore/detail/browser-extension-explore/jnofdoejfipgalklopidpdeofjebihcf https://chrome.google.com/webstore/detail/browser-extension-....
- galuggus 4y agoThe book looks great. I want to build an ad-blocker. Could you recommend a good open source projects to learn from? Previous extension I made: www.fuckoff.yt
- mfrisbie 4y agoThe best mv2 repository would of course be ublock origin: https://github.com/gorhill/uBlock https://github.com/gorhill/uBlock The best mv3 repository would be AdGuard's https://github.com/AdguardTeam/AdGuardMV3 https://github.com/AdguardTeam/AdGuardMV3 For a generalized ad blocker, importing and updating filter lists is probably the most challenging bit. https://kb.adguard.com/en/general/adguard-ad-filters https://kb.adguard.com/en/general/adguard-ad-filters AdGuard has an amazing blog, their content is impressively broad and deep https://adguard.com/en/blog/how-ad-blocking-is-done.html https://adguard.com/en/blog/how-ad-blocking-is-done.html
- galuggus 4y agoThanks
- julianeon 4y agoGreat idea for a book. I'll get it.
- mfrisbie 4y agoThanks! It should be available sometime next week.
- vax425 4y agoWelcome to the club! I’m working on a browser extension right now. HTTPS://headlamptest.com
- RheingoldRiver 4y agoThat's awesome! I preordered. I've written one tiny browser extension once, which was really just for my own use, and I was a bit surprised at how hard it was to find anything that taught how to do it from beginning to end. The APIs were all well-documented, and there was a tutorial extension I could clone, but after that I was really left to searching through random blog posts and StackOverflow for help, since even with good documentation "what is possible in the first place" is hard to figure out. It took me a full day to write an extension to mute all tabs whose name matched a regex pattern. That's it, that's the entire extension, and I wasn't even interested in making it cross-browser. (The use case is that you pair its hotkey with an autohotkey script and then it's actually quite useful.) Since then, I've on occasion had interest in making some other browser extensions, but I always look back to that experience & the lack of resources and just think ehhhhhh do I really want to? I'm sure I could but just how much do I care about this, and the answer has never been enough.
- mfrisbie 4y agoI found the lack of examples and mv2/mv3 fragmentation to be very irritating. For example, the Omnibox API is awesome - yet look at the documentation: https://developer.chrome.com/docs/extensions/reference/omnibox/ https://developer.chrome.com/docs/extensions/reference/omnib... . It barely scrapes the surface of what it should or can do. If you're looking to get back on the horse, check out Plasmo https://www.plasmo.com/ https://www.plasmo.com/. It's by far the best and easiest platform for building and deploying extensions.
- mdp2021 4y ago> how incredibly powerful To the best of the updates to my knowledge, they are much less powerful now than when we could use XUL many years ago... I am not aware that the lackings forced around the time of the deprecation of XUL got fixed. I still use browser forks to keep on using those vital extensions of yore (Scrapbook etc).
- delaaxe 4y agoWhat are the biggest differences with manifest v3?
- mfrisbie 4y agoThe change that gets the most attention is the shift away from blocking webRequest to declarativeNetRequest, but other important changes are moving from background pages to service workers, and disallowing third party JS. Service workers are particularly problematic for some extensions, as the background script cannot execute indefinitely. I included an entire chapter on mv2->mv3 since there was so much to cover.
- mindcrime 4y agoOh, that is perfect timing. After finally starting to use Mastodon and the Fediverse a lot more in the past couple of weeks, I had an idea recently for a browser extension I'd like to take a stab at writing (if it doesn't already exist, to be honest I haven't gone looking yet). Still, even if it does already exist, I might write my own anyway just to finally get around to learning more about how to write browser extensions.
- adnanaga 4y agoI absolutely love making chrome extensions - my very first one was creating an extension for tinder.com that would swipe left on anyone with the first name Chad. https://chrome.google.com/webstore/detail/chad-free-zone/jiahkbcijeildjopfnjcgoildcjjejkm https://chrome.google.com/webstore/detail/chad-free-zone/jia...