From a957e61a9ca05c35e6f40697a343f8c815b6edea Mon Sep 17 00:00:00 2001 From: Sebastian Date: Tue, 2 May 2023 09:56:44 -0300 Subject: fix #7828 --- .../taler-wallet-webextension/src/platform/chrome.ts | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'packages/taler-wallet-webextension/src/platform/chrome.ts') 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 { }); } -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(); }); } -- cgit v1.2.3