aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-webextension/src/wallet/DeveloperPage.tsx
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2022-12-22 18:42:18 -0300
committerSebastian <sebasjm@gmail.com>2022-12-22 18:42:18 -0300
commitdc002f99a96752d3f0a10efe44a8a4d0503e8529 (patch)
tree52ae5cc1239a6aafb6e2f18b774d1d4f4d2afa60 /packages/taler-wallet-webextension/src/wallet/DeveloperPage.tsx
parent5c84c3273668fa5aaeb2ac040eb7b13ad439549c (diff)
downloadwallet-core-dc002f99a96752d3f0a10efe44a8a4d0503e8529.tar.xz
support for ext+taler:// while taler:// is not yet allowed as scheme
Diffstat (limited to 'packages/taler-wallet-webextension/src/wallet/DeveloperPage.tsx')
-rw-r--r--packages/taler-wallet-webextension/src/wallet/DeveloperPage.tsx60
1 files changed, 59 insertions, 1 deletions
diff --git a/packages/taler-wallet-webextension/src/wallet/DeveloperPage.tsx b/packages/taler-wallet-webextension/src/wallet/DeveloperPage.tsx
index 0916f4f43..4805c03ca 100644
--- a/packages/taler-wallet-webextension/src/wallet/DeveloperPage.tsx
+++ b/packages/taler-wallet-webextension/src/wallet/DeveloperPage.tsx
@@ -170,7 +170,7 @@ export function View({
<p>
<i18n.Translate>Debug tools</i18n.Translate>:
</p>
- <Grid container justifyContent="space-between" spacing={1}>
+ <Grid container justifyContent="space-between" spacing={1} size={4}>
<Grid item>
<Button
variant="contained"
@@ -251,6 +251,64 @@ export function View({
<i18n.Translate>export database</i18n.Translate>
</Button>
</Grid>
+ <Grid item>
+ <Button
+ variant="contained"
+ onClick={async () => {
+ navigator.registerProtocolHandler(
+ "taler",
+ `${window.location.origin}/static/wallet.html#/cta/withdraw?talerWithdrawUri=%s`,
+ );
+ }}
+ >
+ <i18n.Translate>Register taler:// handler</i18n.Translate>
+ </Button>
+ </Grid>
+ <Grid item>
+ <Button
+ variant="contained"
+ onClick={async () => {
+ const n = navigator as any;
+ if ("unregisterProtocolHandler" in n) {
+ n.unregisterProtocolHandler(
+ "taler",
+ `${window.location.origin}/static/wallet.html#/cta/withdraw?talerWithdrawUri=%s`,
+ );
+ }
+ }}
+ >
+ <i18n.Translate>Remove taler:// handler</i18n.Translate>
+ </Button>
+ </Grid>{" "}
+ <Grid item>
+ <Button
+ variant="contained"
+ onClick={async () => {
+ navigator.registerProtocolHandler(
+ "ext+taler",
+ `${window.location.origin}/static/wallet.html#/cta/withdraw?talerWithdrawUri=%s`,
+ );
+ }}
+ >
+ <i18n.Translate>Register ext+taler:// handler</i18n.Translate>
+ </Button>
+ </Grid>
+ <Grid item>
+ <Button
+ variant="contained"
+ onClick={async () => {
+ const n = navigator as any;
+ if ("unregisterProtocolHandler" in n) {
+ n.unregisterProtocolHandler(
+ "ext+taler",
+ `${window.location.origin}/static/wallet.html#/cta/withdraw?talerWithdrawUri=%s`,
+ );
+ }
+ }}
+ >
+ <i18n.Translate>Remove ext+taler:// handler</i18n.Translate>
+ </Button>
+ </Grid>{" "}
</Grid>
{downloadedDatabase && (
<div>