Building Browser Extensions with React - That Don't Break Browsers

Bookmark
Rate this content

Browser extensions face unique challenges that web apps never encounter - from Manifest V3 constraints to cross-script communication. After 4+ years building production ready browser extensions in React, I'll share the architecture patterns, performance optimizations, and debugging techniques that prevent extensions from breaking user browsing experience. You'll learn battle-tested solutions for state management across tabs, inter-script communication, and the performance pitfalls that can kill your extension's adoption.

This talk has been presented at React Summit US 2025, check out the latest edition of this React Conference.

FAQ

The speaker is Jonny Fekete, who has over five years of experience working with production-ready web extensions and contributes to open-source projects in this field.

Jonny Fekete's presentation focuses on how to build web extensions using React that do not break browsers.

Web extensions are essentially zip files that include a manifest.json file, which describes permissions, the extension's name, description, version number, and other configurations.

Chrome transitioned from manifest.v2 to manifest.v3, introducing a more streamlined and safe version of manifest.json with more restrictive permissions but greater power for end users.

The recommended framework is WXT, which is described as Next.js for extensions and comes with features like fast hot module reloading and React support.

Challenges include state persistence, multi-tab state management, CSS collision, communication between web pages and extensions, authentication, and memory leak issues.

Using Shadow DOM and custom web components to wrap React bundles can prevent CSS collision by isolating styles from the underlying web page.

Web extensions use the sendMessage API to communicate between different parts like popups and background scripts. Chrome.runtime.sendMessage and Chrome.runtime.onMessage.addListener are used for sending and receiving messages.

Cleanup is critical for production stability, and developers should use throttling and debouncing to manage background script load effectively.

Jonny Fekete offers a free YouTube tutorial series at webextensiontutorial.com.

Johnny Fekete
Johnny Fekete
20 min
21 Nov, 2025

Comments

Sign in or register to post your comment.
Video Summary and Transcription
Jonny Fekete discusses building web extensions with React, the simplicity of manifest.json, the shift from manifest.v2 to manifest.v3 in Chrome, and the impact on functionalities like persistent background scripts and access restrictions. The transition to manifest.v3 for web extensions, the siloed contexts of web extensions, and the use of sendMessage API for communication between different contexts. Challenges in web extension development, complexities of setting up custom configurations, and the modern approach with the WXT framework for easier development and state persistence. Challenges in state persistence and data storage in web extensions, including local, session, and event sync storage methods. Managing multiple tabs' state and data storage with consideration for tab IDs to prevent memory leaks. Consider using storage over Redux for better debugging and architecture. Address CSS collision with Shadow DOM and custom web components to isolate styles from the underlying web page. Utilize background script for throttling and debouncing, efficient storage utilization, and the WXT framework for ease of development and communication.
Video transcription and chapters available for users with access.

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

Install Nothing: App UIs With Native Browser APIs
JSNation 2024JSNation 2024
31 min
Install Nothing: App UIs With Native Browser APIs
Top Content
This Talk introduces real demos using HTML, CSS, and JavaScript to showcase new or underutilized browser APIs, with ship scores provided for each API. The dialogue element allows for the creation of modals with minimal JavaScript and is supported by 96% of browsers. The web animations API is a simple and well-supported solution for creating animations, while the view transitions API offers easy animation workarounds without CSS. The scroll snap API allows for swipers without JavaScript, providing a smooth scrolling experience.
Pushing the Limits of Video Encoding in Browsers With WebCodecs
JSNation 2023JSNation 2023
25 min
Pushing the Limits of Video Encoding in Browsers With WebCodecs
Top Content
Watch video: Pushing the Limits of Video Encoding in Browsers With WebCodecs
This Talk explores the challenges and solutions in video encoding with web codecs. It discusses drawing and recording video on the web, capturing and encoding video frames, and introduces the WebCodecs API. The Talk also covers configuring the video encoder, understanding codecs and containers, and the video encoding process with muxing using ffmpeg. The speaker shares their experience in building a video editing tool on the browser and showcases Slantit, a tool for making product videos.
WebHID API: Control Everything via USB
JSNation 2022JSNation 2022
23 min
WebHID API: Control Everything via USB
Today's Talk introduces the webHID API, which allows developers to control real devices from the browser via USB. The HID interface, including keyboards, mice, and gamepads, is explored. The Talk covers device enumeration, input reports, feature reports, and output reports. The use of HID in the browser, especially in Chrome, is highlighted. Various demos showcase working with different devices, including a DualShock controller, microphone, gamepad, and Stream Deck drum pad. The Talk concludes with recommendations and resources for further exploration.
Automate the Browser With Workers Browser Rendering API
JSNation 2024JSNation 2024
20 min
Automate the Browser With Workers Browser Rendering API
The Talk discusses browser automation using the Worker's Browser Rendering API, which allows tasks like navigating websites, taking screenshots, and creating PDFs. Cloudflare integrated Puppeteer with their workers to automate browser tasks, and their browser rendering API combines remote browser isolation with Puppeteer. Use cases for the API include taking screenshots, generating PDFs, automating web applications, and gathering performance metrics. The Talk also covers extending sessions and performance metrics using Durable Objects. Thank you for attending!
Visualising Front-End Performance Bottlenecks
React Summit 2020React Summit 2020
34 min
Visualising Front-End Performance Bottlenecks
React's web-based tools allow for independent learning. Dazzone, a sports streaming service, faces challenges with low memory and CPU targets. Measuring, analyzing, and fixing performance issues is crucial. Virtualization improves rendering efficiency and performance. The application is now much faster with significantly less jank.
MIDI in the Browser... Let's Rock the Web!
JSNation 2022JSNation 2022
28 min
MIDI in the Browser... Let's Rock the Web!
MIDI is a versatile communication protocol that extends beyond music and opens up exciting possibilities. The Web MIDI API allows remote access to synths and sound modules from web browsers, enabling various projects like music education systems and web audio-based instruments. Developers can connect and use MIDI devices easily, and the Web MIDI API provides raw MIDI messages without semantics. The WebMidi.js library simplifies working with the Web MIDI API and offers a user-friendly interface for musicians and web developers. MIDI on the web has generated significant interest, with potential for commercial growth and endless possibilities for web developers.

Workshops on related topic

Writing Universal Modules for Deno, Node and the Browser
Node Congress 2022Node Congress 2022
57 min
Writing Universal Modules for Deno, Node and the Browser
Workshop
Luca Casonato
Luca Casonato
This workshop will walk you through writing a module in TypeScript that can be consumed users of Deno, Node and the browsers. I will explain how to set up formatting, linting and testing in Deno, and then how to publish your module to deno.land/x and npm. We’ll start out with a quick introduction to what Deno is.