{"id":13341502,"url":"https://github.com/theberrigan/rust-wasm-chrome-ext","last_synced_at":"2025-05-12T21:21:01.737Z","repository":{"id":172043612,"uuid":"648709349","full_name":"theberrigan/rust-wasm-chrome-ext","owner":"theberrigan","description":"Simple example of Chrome extension (with manifest v3) using Rust compiled to Wasm","archived":false,"fork":false,"pushed_at":"2024-11-28T06:41:57.000Z","size":14,"stargazers_count":21,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-20T17:40:40.724Z","etag":null,"topics":["chrome","extension-chrome","manifest-v3","rust","wasm","wasm-pack","web-assembly"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/theberrigan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-06-02T15:57:07.000Z","updated_at":"2025-04-01T22:59:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"f57d4d47-c33f-4f06-8852-d60048127dc3","html_url":"https://github.com/theberrigan/rust-wasm-chrome-ext","commit_stats":null,"previous_names":["theberrigan/rust-wasm-chrome-ext"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theberrigan%2Frust-wasm-chrome-ext","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theberrigan%2Frust-wasm-chrome-ext/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theberrigan%2Frust-wasm-chrome-ext/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theberrigan%2Frust-wasm-chrome-ext/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/theberrigan","download_url":"https://codeload.github.com/theberrigan/rust-wasm-chrome-ext/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253823699,"owners_count":21969890,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chrome","extension-chrome","manifest-v3","rust","wasm","wasm-pack","web-assembly"],"created_at":"2024-07-29T19:25:28.781Z","updated_at":"2025-05-12T21:21:01.718Z","avatar_url":"https://github.com/theberrigan.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rust Web Assembly Chrome Extension Example\n\n## Setup\n1. Install [wasm-pack](https://rustwasm.github.io/wasm-pack/installer/):\n\n   ```\n   cargo install wasm-pack\n   ```\n2. Go to ```/wasm_mod``` and run ```build.bat```. \u003cbr/\u003e\n   It will compile the ```.wasm``` module and ```.js```-wrapper for it and put them in the ```extension/js/wasm```\n3. Go to Chrome extensions page and load unpacked extension from ```/extension```\n\n## Notes \n- ```extension/js/content.js``` demonstrates how to load wasm into the content script \u003cbr/\u003e\n  **Important:** in the content script, the module can only be loaded for those sites whose Content Security Policy does not prohibit it\n- ```extension/js/background.js``` demonstrates how to load wasm into the background worker script\n- For ```wasm-pack``` always use ```--target web```\n- ```manifest.json```:\n    - To load the wasm module into the content script, you should list ```.wasm``` and corresponding ```.js``` in the ```web_accessible_resources.resources``` section of manifest\n    - To load the wasm module into the background worker script, you should specify ```wasm-unsafe-eval``` in the ```content_security_policy.extension_pages``` section of manifest\n\n## Tested with\n- Chrome 114 (extension manifest v3)\n- Rust 1.70 (edition 2021)\n- wasm-bindgen 0.2.86\n- wasm-pack 0.11.1","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheberrigan%2Frust-wasm-chrome-ext","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheberrigan%2Frust-wasm-chrome-ext","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheberrigan%2Frust-wasm-chrome-ext/lists"}