This is a Chrome extension built using the Rust programming language and the Leptos framework. The extension is intended to serve the SNEK Web3 Community and act as a Central Place to coordinate raiding , Quick access to all SNEK ecosystem and many fun features ! .
Reactive UI: Built using the Leptos framework for a fast and responsive user interface.
Background Worker: Handles periodic tasks (e.g., sending HTTP requests) even when the extension is closed.
Custom Icons: Includes custom icons for the extension.
WASM Integration: Uses WebAssembly (WASM) for high-performance Rust code in the browser.
Before you begin, ensure you have the following installed:
Rust: Install Rust from rustup.rs.
wasm-bindgen: Install it using Cargo:
bashCopycargo install wasm-bindgen-cli
Chrome Browser: To load and test the extension.
Clone this repository:
bashCopygit clone https://github.com/your-username/leptos-chrome-extension.git cd leptos-chrome-extension
Install dependencies:
Ensure all dependencies in
Cargo.toml
are installed by running:bashCopycargo build
To build the extension, run the provided build.bat
script. This script performs the following steps:
Cleans the previous build.
Compiles the Rust code to WebAssembly (WASM).
Generates WASM bindings using
wasm-bindgen
.Copies necessary files (HTML, JS, CSS, manifest, and icons) to the
pkg
folder.
Open a terminal in the project directory.
Run the
build.bat
script:bashCopybuild.bat
If the build is successful, you should see the following output:
CopyBuild complete! Files are in pkg\ directory.
Open Chrome and navigate to
chrome://extensions/
.Enable Developer Mode (toggle in the top-right corner).
Click Load unpacked and select the
pkg
folder generated by the build script.The extension will now appear in your extensions list. Click on it to open the popup.
Here’s an overview of the project structure:
leptos-chrome-extension/ ├── src/ │ └── lib.rs # Main Rust code for the extension ├── pkg/ # Output folder for the build (generated by build.bat) ├── icons/ # Folder containing extension icons │ ├── snek_icon_16.png │ ├── snek_icon_48.png │ └── snek_icon_128.png ├── index.html # Popup HTML file ├── popup.js # JavaScript to initialize the WASM module ├── background.js # Background worker script ├── styles.css # Styles for the extension UI ├── manifest.json # Chrome extension manifest ├── Cargo.toml # Rust project configuration ├── build.bat # Build script for Windows └── README.md # This file
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.
Leptos Framework for providing a reactive UI framework for Rust.
wasm-bindgen for seamless integration between Rust and JavaScript.