Compiling from Rust to WebAssembly NPM for React App and Chrome Extension


The data flow is as following:

  1. Click Encrypt button in React App
  2. React App passes the encrypted string to Chrome Extension content script with window.postMessage
  3. Chrome Extension content script pass the encrypted string to Chrome Extension service worker with chrome.runtime.sendMessage
  4. Chrome Extension service worker pass the decrypted string to Chrome Extension content script with the sendResponsecallback of chrome.runtime.onMessage

The 3 repos are open sourced at here:

  • https://github.com/wk3368/rust-rsa-wasm-npm

  • https://github.com/wk3368/hello-wasm-app

  • https://github.com/wk3368/hello-wasm-extension

For more detail, please go to https://medium.com/@wk3368/compiling-from-rust-to-webassembly-npm-for-react-app-and-chrome-extension-64a49a42416

你可能感兴趣的:(rust,wasm,npm)