This repository contains samples of browser extensions built with Blazor using Blazor.BrowserExtension.
Each directory contains the source file in src
and the published files in dist
.
- Runtime Messaging API
- Tabs Messaging API
- Bookmarks API
- Override default new tab page
- Content scripts
- Content scripts
- Messaging
- Side panel
- Tabs API
You can compile and load the projects yourself or just load the published files directly in the browser.
- Launch the Extensions page ( ⋮ → Extensions → Manage Extensions) or navigate to the URL chrome://extensions/.
- Switch on
Developer mode
. - Click on the
Load unpacked
button, then navigate tosampleproject\dist
and select the folderbrowserextension
.
- Launch the Extensions page ( ⋮ → Extensions → Manage Extensions) or navigate to the URL edge://extensions/.
- Click on the ☰ and switch on
Developer mode
. - Click on the button with the title
Load unpacked
, then navigate tosampleproject\dist
and select the folderbrowserextension
.
- Navigate to the URL about:debugging#/runtime/this-firefox.
- Click on
Load Temporary Add-on...
, then navigate tosampleproject\dist\browserextension
and select any file in the directory.
There are plenty of sample extensions provided by Google and Mozilla which is based on JavaScript, HTML and CSS, all of which can be ported to Razor HTML and Blazor scoped CSS.
These samples are good references to how certain features can be implemented, including what API to use and how the manifest is declared.