Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mubelotix/wasm-extension-template
An easy-to-use template for Rust web extensions. The Rust code is compiled to WASM and ran as a content script.
https://github.com/mubelotix/wasm-extension-template
extension rust template wasm web webextension
Last synced: 2 days ago
JSON representation
An easy-to-use template for Rust web extensions. The Rust code is compiled to WASM and ran as a content script.
- Host: GitHub
- URL: https://github.com/mubelotix/wasm-extension-template
- Owner: Mubelotix
- Created: 2020-05-24T09:06:37.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-10-03T16:49:09.000Z (3 months ago)
- Last Synced: 2024-12-14T04:07:14.469Z (9 days ago)
- Topics: extension, rust, template, wasm, web, webextension
- Language: Shell
- Homepage:
- Size: 31.3 KB
- Stars: 205
- Watchers: 7
- Forks: 10
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# WASM Extension Template
Use this template to quickly generate an empty *Hello World* web extension in Rust. This will get your code executed the right way.
Supports both manifest v2 and v3.
Will install wasm-specific build tools for you.
## Install tools
```sh
cargo install cargo-generate
cargo install wasm-pack
```## Generate an extension
You can use `cargo-generate` to generate a new crate (modify the name at the end of the command):
```sh
cargo generate --git https://github.com/Mubelotix/wasm-extension-template --name amazing-extension
```Your crate is now generated and ready to be compiled.
## Compile your extension
You cannot use `cargo build` to compile your crate. Use the `build.sh` script instead:
```sh
sh build.sh
```Once compiled, the target files are ready to be used in the `pkg` folder.
## Test your program
Web browsers allow developpers to test web extensions before publishment.
See your browser's specific instructions to do that.
After build, the `manifest.json` file is located in the `pkg` folder.
By default, your extension will run on example.com and have no other permissions.
You should want to modify the manifest (see [the doc](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json)).