Skip to content

vivekVells/rust-chrome-extension

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust Chrome Extension Example

A simple Chrome extension that demonstrates using Rust with WebAssembly.

Demo

Extension Demo

Setup

  1. Install dependencies:
# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# Install wasm-pack
cargo install wasm-pack
  1. Build the extension:
npm run build
  1. Load in Chrome:
  • Open chrome://extensions
  • Enable Developer mode
  • Click "Load unpacked"
  • Select the dist directory

Available Scripts

  • npm run clean - Clean all build outputs
  • npm run build - Build the extension

Structure

rust-chrome-extension/
├── Cargo.toml           # Rust dependencies and build config
├── src/
│   └── lib.rs          # Rust code (WebAssembly source)
├── manifest.json        # Chrome extension manifest
├── popup.html          # Extension popup UI
├── popup.js            # JavaScript code for the popup
└── pkg/                # Generated after build (contains compiled WebAssembly)
    ├── rust_chrome_extension_bg.wasm
    └── rust_chrome_extension.js

Releases

No releases published

Packages

No packages published