Skip to content

Commit

Permalink
Add bitcoin protocol handler for PWA
Browse files Browse the repository at this point in the history
Closes MutinyWallet#547

In my testing I could only make the `bitcoin` handler work. This is likely due to the ["safelisted schemes"](https://html.spec.whatwg.org/multipage/system-state.html#safelisted-scheme).
The `send?invoice=%s` url was already being handled by the `parsePaste` function but the invoice data wasn't getting picked up, so I had to add the `handleDestination` call in there.
  • Loading branch information
alpeb-btc committed Feb 21, 2024
1 parent 9db53cc commit e6ce8b1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,12 @@ const manifest: Partial<ManifestOptions> = {
}
]
}
],
protocol_handlers: [
{
protocol: "bitcoin",
url: "/send?invoice=%s"
}
]
};

Expand Down
2 changes: 1 addition & 1 deletion src/routes/Send.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ export function Send() {
},
(result) => {
actions.setScanResult(result);
navigate("/send", { state: { previous: "/search" } });
handleDestination(state.scan_result);
}
);
}
Expand Down

0 comments on commit e6ce8b1

Please sign in to comment.