Skip to content

feat: Add dApp browser with wallet API injection for desktop app#89

Merged
WiktorStarczewski merged 8 commits intomainfrom
tauri-dapp-browser
Jan 23, 2026
Merged

feat: Add dApp browser with wallet API injection for desktop app#89
WiktorStarczewski merged 8 commits intomainfrom
tauri-dapp-browser

Conversation

@WiktorStarczewski
Copy link
Copy Markdown
Collaborator

Summary

  • Adds a dedicated dApp browser window to the desktop Tauri app
  • Injects window.midenWallet API into dApp pages for wallet connectivity
  • Shows confirmation overlay in dApp window for connection/transaction approval

Changes

  • New dApp browser window (src-tauri/src/dapp_browser.rs) - Opens external dApps in a separate Tauri webview with
    navigation controls
  • Wallet API injection (src-tauri/scripts/dapp-injection.js) - Implements MidenWindowObject interface compatible
    with @demox-labs/miden-wallet-adapter-miden
  • Confirmation overlay (src/lib/desktop/DesktopDappConfirmationModal.tsx) - Injects approval UI directly into dApp
    webview
  • Request handling (src/lib/desktop/DesktopDappHandler.tsx) - Processes wallet requests from dApps using existing
    message handler infrastructure
  • TypeScript bindings (src/lib/desktop/dapp-browser.ts) - Tauri command wrappers and overlay generation

How it works

  1. User clicks "Open in dApp Browser" from the browser page
  2. dApp loads in separate window with injected window.midenWallet
  3. dApp calls connect() or transaction methods
  4. Request is sent via URL interception (https://miden-wallet-request/{base64-payload})
  5. Confirmation overlay appears in dApp window
  6. Response flows back to dApp via same URL pattern

…jection

- Add browser tab to footer for desktop platform
- Create Rust dapp_browser module with window management commands
- Implement toolbar injection script with back/forward/refresh/close
- Add wallet API (window.midenWallet) for dApp connectivity
- Create DesktopDappHandler to process wallet requests from dApps
- dApp window opens at 1200x800 for comfortable browsing
- Fix ReDoS vulnerability in URL_PATTERN regex
- Fix cross-window postMessage to use explicit origin
- Add explicit permissions to build workflow
@WiktorStarczewski WiktorStarczewski merged commit 937bdf4 into main Jan 23, 2026
9 checks passed
@WiktorStarczewski WiktorStarczewski deleted the tauri-dapp-browser branch January 23, 2026 01:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants