diff options
Diffstat (limited to 'packages/taler-wallet-webextension/src/platform')
3 files changed, 15 insertions, 1 deletions
diff --git a/packages/taler-wallet-webextension/src/platform/api.ts b/packages/taler-wallet-webextension/src/platform/api.ts index 76add93d1..d425a9992 100644 --- a/packages/taler-wallet-webextension/src/platform/api.ts +++ b/packages/taler-wallet-webextension/src/platform/api.ts @@ -234,12 +234,17 @@ export interface ForegroundPlatformAPI { /** * Popup API * - * Open a page into the wallet UI and closed the popup + * Open a page into the wallet UI and close the popup * @param page */ openWalletPageFromPopup(page: string): void; /** + * Open a page and close the popup + * @param url + */ + openNewURLFromPopup(url: URL): void; + /** * Get the wallet version from manifest */ getWalletWebExVersion(): WalletWebExVersion; diff --git a/packages/taler-wallet-webextension/src/platform/chrome.ts b/packages/taler-wallet-webextension/src/platform/chrome.ts index 4fb4bddfd..a4394be2c 100644 --- a/packages/taler-wallet-webextension/src/platform/chrome.ts +++ b/packages/taler-wallet-webextension/src/platform/chrome.ts @@ -55,6 +55,7 @@ const api: BackgroundPlatformAPI & ForegroundPlatformAPI = { listenToAllChannels: listenToAllChannels as any, registerReloadOnNewVersion, sendMessageToAllChannels, + openNewURLFromPopup, sendMessageToBackground, useServiceWorkerAsBackgroundProcess, keepAlive, @@ -266,6 +267,13 @@ function openWalletPageFromPopup(page: string): void { chrome.tabs.create({ active: true, url }, () => { window.close(); }); + +} +function openNewURLFromPopup(url: URL): void { + // const url = chrome.runtime.getURL(`/static/wallet.html#${page}`); + chrome.tabs.create({ active: true, url: url.href }, () => { + window.close(); + }); } let nextMessageIndex = 0; diff --git a/packages/taler-wallet-webextension/src/platform/dev.ts b/packages/taler-wallet-webextension/src/platform/dev.ts index 02d11566a..8d37930fa 100644 --- a/packages/taler-wallet-webextension/src/platform/dev.ts +++ b/packages/taler-wallet-webextension/src/platform/dev.ts @@ -35,6 +35,7 @@ const api: BackgroundPlatformAPI & ForegroundPlatformAPI = { findTalerUriInActiveTab: async () => undefined, findTalerUriInClipboard: async () => undefined, listenNetworkConnectionState, + openNewURLFromPopup: () => undefined, getPermissionsApi: () => ({ addPermissionsListener: () => undefined, containsHostPermissions: async () => true, |