aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-webextension/src
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-wallet-webextension/src')
-rw-r--r--packages/taler-wallet-webextension/src/NavigationBar.tsx6
-rw-r--r--packages/taler-wallet-webextension/src/taler-wallet-interaction-loader.ts9
-rw-r--r--packages/taler-wallet-webextension/src/taler-wallet-interaction-support.ts6
-rw-r--r--packages/taler-wallet-webextension/src/wallet/Application.tsx22
-rw-r--r--packages/taler-wallet-webextension/src/wxBackend.ts2
5 files changed, 38 insertions, 7 deletions
diff --git a/packages/taler-wallet-webextension/src/NavigationBar.tsx b/packages/taler-wallet-webextension/src/NavigationBar.tsx
index 7d469ed7e..8dfa87d9c 100644
--- a/packages/taler-wallet-webextension/src/NavigationBar.tsx
+++ b/packages/taler-wallet-webextension/src/NavigationBar.tsx
@@ -112,7 +112,7 @@ export const Pages = {
balanceTransaction: pageDefinition<{ tid: string }>(
"/balance/transaction/:tid",
),
- bankManange: pageDefinition<{ scope: CrockEncodedString}>(
+ bankManange: pageDefinition<{ scope: CrockEncodedString }>(
"/bank/manage/:scope",
),
balanceDeposit: pageDefinition<{
@@ -148,13 +148,15 @@ export const Pages = {
),
defaultCta: pageDefinition<{ uri: CrockEncodedString }>("/taler-uri/:uri"),
+ // FIXME: mem leak problems
+ defaultCtaSimple: pageDefinition<{ uri: CrockEncodedString }>("/taler-uri-simple/:uri"),
cta: pageDefinition<{ action: CrockEncodedString }>("/cta/:action"),
ctaPay: "/cta/pay",
ctaPayTemplate: "/cta/pay/template",
ctaRecovery: "/cta/recovery",
ctaRefund: "/cta/refund",
ctaWithdraw: "/cta/withdraw",
- ctaDeposit: pageDefinition<{
+ ctaDeposit: pageDefinition<{
scope: CrockEncodedString;
account: CrockEncodedString,
}>("/cta/deposit/:scope/:account"),
diff --git a/packages/taler-wallet-webextension/src/taler-wallet-interaction-loader.ts b/packages/taler-wallet-webextension/src/taler-wallet-interaction-loader.ts
index 1d0ac314a..37523c667 100644
--- a/packages/taler-wallet-webextension/src/taler-wallet-interaction-loader.ts
+++ b/packages/taler-wallet-webextension/src/taler-wallet-interaction-loader.ts
@@ -21,7 +21,8 @@ import {
} from "@gnu-taler/taler-util";
import type { MessageFromBackend } from "./platform/api.js";
-import { encodeCrockForURI } from "@gnu-taler/web-util/browser";
+// FIXME: mem leak problems
+// import { encodeCrockForURI } from "@gnu-taler/web-util/browser";
/**
@@ -67,7 +68,9 @@ function validateTalerUri(uri: string): boolean {
function convertURIToWebExtensionPath(uri: string) {
const url = new URL(
chrome.runtime.getURL(
- `static/wallet.html#/taler-uri/${encodeCrockForURI(uri)}`,
+ // FIXME: mem leak problems
+ // `static/wallet.html#/taler-uri/${encodeCrockForURI(uri)}`,
+ `static/wallet.html#/taler-uri-simple/${encodeURIComponent(uri)}`,
),
);
return url.href;
@@ -82,7 +85,7 @@ const shouldNotInject =
!rootElementIsHTML;
const logger = {
- debug: (...msg: any[]) => {},
+ debug: (...msg: any[]) => { },
info: (...msg: any[]) =>
console.log(`${new Date().toISOString()} TALER`, ...msg),
error: (...msg: any[]) =>
diff --git a/packages/taler-wallet-webextension/src/taler-wallet-interaction-support.ts b/packages/taler-wallet-webextension/src/taler-wallet-interaction-support.ts
index 0c6074c42..c6d96ba01 100644
--- a/packages/taler-wallet-webextension/src/taler-wallet-interaction-support.ts
+++ b/packages/taler-wallet-webextension/src/taler-wallet-interaction-support.ts
@@ -24,7 +24,7 @@ import { encodeCrockForURI } from "@gnu-taler/web-util/browser";
*/
(() => {
const logger = {
- debug: (..._msg: unknown[]) => {},
+ debug: (..._msg: unknown[]) => { },
info: (...msg: unknown[]) =>
console.log(`${new Date().toISOString()} TALER`, ...msg),
error: (...msg: unknown[]) =>
@@ -78,7 +78,9 @@ import { encodeCrockForURI } from "@gnu-taler/web-util/browser";
return undefined;
}
const host = `${config.protocol}//${config.hostname}`;
- const path = `static/wallet.html#/taler-uri/${encodeCrockForURI(uri)}`;
+ // FIXME: mem leak problems
+ // const path = `static/wallet.html#/taler-uri/${encodeCrockForURI(uri)}`;
+ const path = `static/wallet.html#/taler-uri-simple/${encodeURIComponent(uri)}`;
return `${host}/${path}`;
}
diff --git a/packages/taler-wallet-webextension/src/wallet/Application.tsx b/packages/taler-wallet-webextension/src/wallet/Application.tsx
index d9206ce11..90102dc09 100644
--- a/packages/taler-wallet-webextension/src/wallet/Application.tsx
+++ b/packages/taler-wallet-webextension/src/wallet/Application.tsx
@@ -502,6 +502,28 @@ export function Application(): VNode {
return <Redirect to={path} />;
}}
/>
+ {/* // FIXME: mem leak problems */}
+ <Route
+ path={Pages.defaultCtaSimple.pattern}
+ component={({ uri }: { uri: string }) => {
+ const path = getPathnameForTalerURI(decodeURIComponent(uri));
+ if (!path) {
+ return (
+ <CallToActionTemplate title={i18n.str`Taler URI handler`}>
+ <AlertView
+ alert={{
+ type: "warning",
+ message: i18n.str`Could not found a handler for the Taler URI`,
+ description: i18n.str`The uri read in the path parameter is not valid: "${uri}"`,
+ }}
+ />
+ </CallToActionTemplate>
+ );
+ }
+ return <Redirect to={path} />;
+ }}
+ />
+
<Route
path={Pages.ctaPay}
component={({ talerUri }: { talerUri: string }) => (
diff --git a/packages/taler-wallet-webextension/src/wxBackend.ts b/packages/taler-wallet-webextension/src/wxBackend.ts
index ab3c465c4..cdc9e6a15 100644
--- a/packages/taler-wallet-webextension/src/wxBackend.ts
+++ b/packages/taler-wallet-webextension/src/wxBackend.ts
@@ -483,6 +483,7 @@ async function reinitWallet(): Promise<void> {
return;
}
wallet.addNotificationListener((message) => {
+ logger.trace("Wallet -> Webex", message)
if (settings.showWalletActivity) {
addNewWalletActivityNotification(activity, message);
}
@@ -521,6 +522,7 @@ export async function wxMain(): Promise<void> {
logger.trace("listen all channels");
platform.listenToAllChannels(async (message, from) => {
//wait until wallet is initialized
+ logger.trace("Webex -> Wallet", message)
await afterWalletIsInitialized;
const result = await dispatch(message, from);
return result;