Building a Chrome extension was too hard, so I wrote a book to make it easy.
Garbage documentation, stale examples, and manifest v3 woes all work against extension developers. "Building Browser Extensions" makes all that go away.
The world of browser extensions has far more than meets the eye. Consider the following:
On average, 40% of internet users in the United States use an adblocker on any device; overwhelmingly, these adblockers take the form of browser extensions.
The tech company Honey, whose primary product is a browser extension, was acquired by PayPal in 2020 for $4 billion.
As of 2021, there were 1.8 million apps in Apple's App Store; the Chrome Web Store has 180,000 extensions.
When I saw there were 0 relevant Amazon search results for "build chrome extension", I nearly fell out of my chair. I knew at once that this book must be written.
Building Browser Extensions: Create Modern Extensions for Chrome, Safari, Firefox, and Edge covers all the knowledge you will need to write cross-browser extensions with the latest web development tools. Browser extensions are given access to extremely powerful APIs. I believe most developers are blind to that power -and unaware of just how much it is within their reach.
This book is designed to enlighten web developers and illuminate the true potential of the browser extension software platform. It is geared for developers who have experience building websites and can apply their knowledge to a new software domain. This book is not ideal for people new to programming - it would be like an inexperienced cook starting off by learning to make a sauce.
A major barrier to developing browser extensions is the appalling status quo of documentation. The fragmentation between different browsers and different manifest versions turns slogging through the documentation into a mind-numbingly onerous affair. I wrote this book specifically to address this problem. The reader will learn what is possible with the APIs, how they can best be applied, and all the traps to avoid. The book is not intended to replace the API documentation, as it is changing all the time. Instead, it is intended to supplement the API documentation; the book has plenty of direct links to the Chrome Developers and MDN sites throughout.
The transition to manifest v3 is upon us, and already it is causing problems. If you are confused about what manifest v3 is, what are its implications, and how best to navigate the ongoing transition, this book is for you. I dedicated an entire chapter to the manifest v2/v3 transition.
The lingua franca of web development is React, and this book gives special attention to the best ways in which you can write a browser extension in React. It also covers all the supplemental tools you'll need along the way, such as Webpack, Parcel, and Plasmo.
Like many developers, I learn by example. I was annoyed that so many APIs listed in the documentation were totally inscrutable. For example, the omnibox API is amazing and incredibly useful, but the documentation on how to use it is garbage. I just wanted a simple example to pick apart and play with, and there was nothing to be found. To fill this need, I created a companion extension for the book: Browser Extension Explorer. It's an open source browser extension with dozens of interactive demos. Each demo shows how various browser extension pieces and APIs work, and each includes links to the specific source files so you can see how it was built.