diff options
author | Sebastian <sebasjm@gmail.com> | 2023-05-02 09:56:44 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2023-05-02 09:57:12 -0300 |
commit | a957e61a9ca05c35e6f40697a343f8c815b6edea (patch) | |
tree | 54f8a83831c6949aabbc785c455c7264d8c086b4 /packages/taler-wallet-webextension/src/platform/chrome.ts | |
parent | 23fca6d8677a1e88dad426691fbe1033595f16a3 (diff) | |
download | wallet-core-a957e61a9ca05c35e6f40697a343f8c815b6edea.tar.xz |
fix #7828
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(); }); } |