Firefox Extension Development: Content Script and HTTP Request

I recently got into Firefox extension development with the WebExtension API. In this tutorial, I will create an example extension that uses a single content script and an XMLHTTPRequest to add duckduckgo result rankings into Google search results. If the result in question appears in duckduckgo results for the same query, an orange box with the position will be placed next to the result. Not insanely useful, but a realistic example to get your feet wet with Firefox extension development.

Screenshot of extension in use, showing Google search results.
Example of extension working. We can see the top result on Google is also the top result on duckduckgo.
Continue reading “Firefox Extension Development: Content Script and HTTP Request”