Logo

dev-resources.site

for different kinds of informations.

Chrome Extension Boilerplate with Popup Interaction (Manifest V3)

Published at
9/4/2024
Categories
extension
chrome
javascript
boilerplate
Author
llagerlof
Author
9 person written this
llagerlof
open
Chrome Extension Boilerplate with Popup Interaction (Manifest V3)

The goal

This boilerplate extension provides developers with a starting point for creating their own Chrome extensions using Manifest V3.

What's new

The biggest improvement in this version is the addition of a popup interface. Now, when users click the extension button in the browser's top bar, they're presented with an interactive popup instead of just logging a message to the console.

Features

This boilerplate demonstrates three key extension behaviors:

  1. Before page load: Print a message to DevTools console before the page loads.
  2. After page load: Print a message to DevTools console before the page loads.
  3. Popup interaction: Displays a popup when the user clicks the extension button, allowing for more complex user interactions.

The extension now provides a button within the popup that, when clicked, injects a script into the active tab to modify the DOM and log a message to the console.

Installation

  1. Clone or download the files from github.com/llagerlof/fresh-chrome-extension and place them in a directory.
  2. Open your browser's extension page: chrome://extensions
  3. Enable "Developer mode" in the top right corner.
  4. Click Load Unpacked and select the extension directory.

How to test it

  1. Open any website.
  2. Click the extension button on the browser's top bar. You'll see a popup with a button.
  3. Click the button in the popup labeled "Click this button to add an orange div to the page".
  4. Observe the following changes:
    • An orange div appears at the top of the page with the message "DOM modified!"
    • Open the developer tools (F12) and look at the console. You'll see the message "Action executed from popup!"

Screenshot of the extension in action

This boilerplate provides a solid foundation for building more complex Chrome extensions. Feel free to modify and extend it to suit your specific needs.

Happy coding!

extension Article's
30 articles in total
Favicon
Avoiding a "Host Permission" Review Delay When Publishing a Chrome Extension
Favicon
Unlock Cleaner Code with Dexter.ai: A must have VS Code extension for Python Development
Favicon
Export LinkedInβ„’ Profile to CV using Browser Extension
Favicon
Learn Spanish Chrome extension
Favicon
A "New Way" to Pay Creators
Favicon
Chrome Extension Boilerplate with Popup Interaction (Manifest V3)
Favicon
How to Build a Simple Chrome Extension to Search Selected Text on YouTube
Favicon
Creating a Chrome extension
Favicon
Create A Vim Plugin For Your Next Programming Language, Indentation and Autocomplete
Favicon
Creating a browser extension for Chrome / Edge
Favicon
Create A Vim Plugin For Your Next Programming Language, Structure, and syntax highlight.
Favicon
Build your own VS Code extension
Favicon
Get Affordable and Non Surgical Hair Patching and Hair Extension In Kolkata
Favicon
Introducing Shell Command 2: The Ultimate Shell Command Runner for VSCode
Favicon
How do ad blockers work in the browser?
Favicon
How to test a browser extension locally
Favicon
Explore the Best VSCode Themes for a Stylish Coding Experience 🌈
Favicon
GPT 4 and Why it is Good for Chrome to Crumble
Favicon
Streamline Your WPF Development with Syncfusion: Introducing the WPF Template Studio for Visual Studio
Favicon
VSCode Extension - Doc Tab: edit the doc comments in a new tab
Favicon
Using External Weather Data In A Custom Panel Extension
Favicon
[AWS] Using API Gateway for S3 Uploads to Trigger Lambda Functions
Favicon
Chrome side panel: Simulate close event
Favicon
Data Storage & Retrieval Troubles with Bookmark Decay
Favicon
Diving into Chrome Extension Development: 3 Essential Resources
Favicon
Developing a Chrome Extension for Bookmark Decay
Favicon
"Bookmark Decay": A Project for Learning
Favicon
Twitch Mention Notifier web extension
Favicon
Looking to partner with a chrome extension partner.
Favicon
How to add a progress bar to terraform cli

Featured ones: