diff options
Diffstat (limited to 'packages/taler-wallet-webextension/src/platform/chrome.ts')
-rw-r--r-- | packages/taler-wallet-webextension/src/platform/chrome.ts | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/packages/taler-wallet-webextension/src/platform/chrome.ts b/packages/taler-wallet-webextension/src/platform/chrome.ts index 51cf2f64e..0f6b5fb0d 100644 --- a/packages/taler-wallet-webextension/src/platform/chrome.ts +++ b/packages/taler-wallet-webextension/src/platform/chrome.ts @@ -20,6 +20,8 @@ import { TalerUriAction, TalerError, parseTalerUri, + TalerUri, + stringifyTalerUri, } from "@gnu-taler/taler-util"; import { WalletOperations } from "@gnu-taler/taler-wallet-core"; import { BackgroundOperations } from "../wxApi.js"; @@ -247,17 +249,8 @@ function notifyWhenAppIsReady(): Promise<void> { }); } -function openWalletURIFromPopup(maybeTalerUri: string): void { - const talerUri = maybeTalerUri.startsWith("ext+") - ? maybeTalerUri.substring(4) - : maybeTalerUri; - const uri = parseTalerUri(talerUri); - if (!uri) { - logger.warn( - `Response with HTTP 402 the Taler header but could not classify ${talerUri}`, - ); - return; - } +function openWalletURIFromPopup(uri: TalerUri): void { + const talerUri = stringifyTalerUri(uri); //FIXME: this should redirect to just one place // the target pathname should handle what happens if the endpoint is not there // like "trying to open from popup but this uri is not handled" @@ -335,7 +328,7 @@ function openWalletURIFromPopup(maybeTalerUri: string): void { } } - chrome.tabs.create({ active: true, url }, () => { + chrome.tabs.update({ active: true, url }, () => { window.close(); }); } |