Skip to content
/ bun-webextension Public template

Template for creating a WebExtension using Bun

License

Notifications You must be signed in to change notification settings

Bellisario/bun-webextension

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bun WebExtension Template

Template for creating a WebExtension using Bun.

Features

  • Bun features/plugins support
  • TypeScript building
  • browser and chrome APIs support
  • chrome API polyfill
  • Prettier configuration

Usage & Development

  1. Clone the repository:
    git clone https://github.com/Bellisario/bun-webextension.git mywebextension && cd mywebextension && rm -rf .git
  2. Install dependencies:
    bun install
  3. Run the dev build (will rebuild on changes):
    bun run dev
  4. Load the extension in your browser:
    • For Chrome: Go to chrome://extensions, enable "Developer mode", and load the unpacked extension from the dist directory.
    • For Firefox: Go to about:debugging#/runtime/this-firefox, click "Load Temporary Add-on", and select the manifest.json file from the dist directory.
  5. When done with development, build the extension with:
    bun run build
    The built extension will be in the dist directory ready to be packed and distributed.

Hot Reloading

Currently hot reloading is not supported. The extension is automatically rebuilt on changes, but you still need to manually reload it in your browser to see the changes.

In the future hot reloading might be added by using a WebSocket connection and reload the extension by calling browser.runtime.reload(), but I'm unsure if this is possible with v3 manifest extensions.

If you have any ideas on how to implement hot reloading, open an issue or a pull request!

Contributing

We ❤️ contributions!
Feel free to open an issue or a pull request but follow Contributing Guidelines.

If you don't know where to start, check out the help wanted issues!

License

This template is available under The Unlicense license.

You are free to do anything with this code and use this template removing the LICENSE file.

If you found this template useful, please consider citing it in your repo's README so others can discover it, too.

About

Template for creating a WebExtension using Bun

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published