From dda90b51f6fc6fca48a68bc53088e1ed3f018a21 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Fri, 9 Sep 2022 12:22:26 -0300 Subject: find taler action in clipboard and withdraw with mobile --- packages/taler-wallet-webextension/src/platform/chrome.ts | 6 ++++++ 1 file changed, 6 insertions(+) (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 4ce995bd7..7311354c9 100644 --- a/packages/taler-wallet-webextension/src/platform/chrome.ts +++ b/packages/taler-wallet-webextension/src/platform/chrome.ts @@ -30,6 +30,7 @@ import { const api: PlatformAPI = { isFirefox, findTalerUriInActiveTab, + findTalerUriInClipboard, getPermissionsApi, getWalletWebExVersion, listenToWalletBackground, @@ -689,6 +690,11 @@ async function findTalerUriInTab(tabId: number): Promise { } } +async function findTalerUriInClipboard(): Promise { + const textInClipboard = await window.navigator.clipboard.readText(); + return textInClipboard.startsWith("taler://") || textInClipboard.startsWith("taler+http://") ? textInClipboard : undefined +} + async function findTalerUriInActiveTab(): Promise { const tab = await getCurrentTab(); if (!tab || tab.id === undefined) return; -- cgit v1.2.3