Preface
Web browsers have become part of our everyday lives, on both our desktops and phones, but often do not come with many of the additional bespoke features many users require. To solve this problem, browser extensions were born. Internet Explorer was one of the first browsers to support extensions as far back as 1997, with many other browser vendors following suit. As time went on, the quality and ability of extensions increased as more functionality and control were given to extensions by browser vendors. Currently, there are over 150,000 different extensions on the Chrome Web Store alone, a number that is growing each year.
The browser we pick is quite a personal choice and is defined by our familiarity and the functionality requirements we have. The list of available browsers is always increasing, with Google Chrome, Mozilla Firefox, Microsoft Edge, Apple Safari, and Opera being the most widely used. For this book, a choice was on the table to select a browser extension framework to describe. As Google Chrome has the highest market share at 66%, it was selected as the basis for this book.
This book was born from a college project my students were working. As they were novice developers, they were still finding their feet in the development world and understanding the dividing lines between technologies. When it came to understanding the basics of extensions and how they interact with the full-stack in the form of servers and databases, they were at a loss to find any relevant examples to guide them. Although Google offers documentation explaining how to build extensions and provides a wealth of examples, these often are missing the crucial elements of how to integrate them into a full technology stack.
To fill this gap, this book is designed to teach you how to develop both Chrome-based extensions and also how to develop and integrate these extensions into a full technology stack. The first chapters in this book cover the basics of extension development and setting up your first API server for the extension to interact with. The later chapters each describe the process of developing an extension to perform a specific task, such as filtering, processing, saving, or retrieving data from the stack. Each chapter in this book contains a solid dividing line between the code for the extension and the code for servers. For each, a detailed set of descriptions is included to show where the interactions between the technologies are performed.
As code is discussed in this book, as a time-saving exercise, it is best to begin by downloading the complete book source code from the book's website https://www.extensionbook.org, and navigate through the book chapters with the complete source code beside you. At the beginning of each chapter, links to the relevant examples are included for the extension being described. Although I have done my best to omit errors, I take full responsibility if any are found, and would greatly appreciate an email from you if you find any yourself.
I hope you enjoy reading this book as much as I enjoyed writing it.
--- Kyle