From dc002f99a96752d3f0a10efe44a8a4d0503e8529 Mon Sep 17 00:00:00 2001
From: Sebastian <sebasjm@gmail.com>
Date: Thu, 22 Dec 2022 18:42:18 -0300
Subject: support for ext+taler:// while taler:// is not yet allowed as scheme

---
 .../src/wallet/DeveloperPage.tsx                   | 60 +++++++++++++++++++++-
 1 file changed, 59 insertions(+), 1 deletion(-)

(limited to 'packages/taler-wallet-webextension/src/wallet/DeveloperPage.tsx')

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>
-- 
cgit v1.2.3

