gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-wallet-core] branch master updated (e2639070 -> 0aa26448)


From: gnunet
Subject: [taler-wallet-core] branch master updated (e2639070 -> 0aa26448)
Date: Mon, 24 Jan 2022 13:46:29 +0100

This is an automated email from the git hooks/post-receive script.

sebasjm pushed a change to branch master
in repository wallet-core.

    from e2639070 fix #4880
     new e38be8d8 using loadingerror
     new 2a417881 fix permission api, grouping all cta into same path
     new 0aa26448 fix: cta header, fix: do not reset ToS ETAG when getting the 
exchange ToS

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../src/NavigationBar.tsx                          |  31 ++---
 .../src/components/ErrorTalerOperation.tsx         |  21 ++--
 .../components/{Loading.tsx => LoadingError.tsx}   |  14 ++-
 .../src/components/TransactionItem.tsx             |   2 +-
 .../taler-wallet-webextension/src/cta/Deposit.tsx  |   4 -
 packages/taler-wallet-webextension/src/cta/Pay.tsx |  98 ++++-----------
 .../taler-wallet-webextension/src/cta/Withdraw.tsx |  33 ++---
 .../src/hooks/useAsyncAsHook.ts                    |  20 ++-
 .../src/hooks/useBackupStatus.ts                   |  81 ------------
 .../src/hooks/useExtendedPermissions.ts            |  43 +++----
 .../taler-wallet-webextension/src/permissions.ts   |   4 +-
 .../src/popup/BalancePage.tsx                      |  17 +--
 .../src/popupEntryPoint.tsx                        |  14 +--
 .../taler-wallet-webextension/src/utils/index.ts   |   8 +-
 .../src/wallet/BackupPage.tsx                      |  69 ++++++++++-
 .../src/wallet/BalancePage.tsx                     |  18 +--
 .../src/wallet/ExchangeSetUrl.tsx                  |   1 -
 .../src/wallet/History.tsx                         |  10 +-
 .../src/wallet/ManualWithdrawPage.tsx              |  25 ++--
 .../src/wallet/Settings.tsx                        |   4 +-
 .../src/walletEntryPoint.tsx                       | 138 +++++++++++++--------
 .../taler-wallet-webextension/src/wxBackend.ts     |  26 ++--
 22 files changed, 310 insertions(+), 371 deletions(-)
 copy packages/taler-wallet-webextension/src/components/{Loading.tsx => 
LoadingError.tsx} (60%)
 delete mode 100644 
packages/taler-wallet-webextension/src/hooks/useBackupStatus.ts

diff --git a/packages/taler-wallet-webextension/src/NavigationBar.tsx 
b/packages/taler-wallet-webextension/src/NavigationBar.tsx
index a2579085..e507bf45 100644
--- a/packages/taler-wallet-webextension/src/NavigationBar.tsx
+++ b/packages/taler-wallet-webextension/src/NavigationBar.tsx
@@ -30,28 +30,29 @@ import { PopupNavigation } from "./components/styled";
 
 export enum Pages {
   welcome = "/welcome",
+
   balance = "/balance",
   balance_history = "/balance/history/:currency",
-  manual_withdraw = "/balance/manual-withdraw/:currency?",
-  deposit = "/balance/deposit/:currency",
-  transaction = "/balance/transaction/:tid",
-  settings = "/settings",
+  balance_manual_withdraw = "/balance/manual-withdraw/:currency?",
+  balance_deposit = "/balance/deposit/:currency",
+  balance_transaction = "/balance/transaction/:tid",
+
   dev = "/dev",
-  cta = "/cta/:action",
+
   backup = "/backup",
+  backup_provider_detail = "/backup/provider/:pid",
+  backup_provider_add = "/backup/provider/add",
+
   last_activity = "/last-activity",
-  provider_detail = "/provider/:pid",
-  provider_add = "/provider/add",
-  exchange_add = "/exchange/add",
 
-  reset_required = "/reset-required",
-  payback = "/payback",
-  return_coins = "/return-coins",
+  settings = "/settings",
+  settings_exchange_add = "/settings/exchange/add",
 
-  pay = "/pay",
-  refund = "/refund",
-  tips = "/tip",
-  withdraw = "/withdraw",
+  cta = "/cta/:action",
+  cta_pay = "/cta/pay",
+  cta_refund = "/cta/refund",
+  cta_tips = "/cta/tip",
+  cta_withdraw = "/cta/withdraw",
 }
 
 interface TabProps {
diff --git 
a/packages/taler-wallet-webextension/src/components/ErrorTalerOperation.tsx 
b/packages/taler-wallet-webextension/src/components/ErrorTalerOperation.tsx
index 8f61c713..a7b66ea3 100644
--- a/packages/taler-wallet-webextension/src/components/ErrorTalerOperation.tsx
+++ b/packages/taler-wallet-webextension/src/components/ErrorTalerOperation.tsx
@@ -13,8 +13,8 @@
  You should have received a copy of the GNU General Public License along with
  GNU Taler; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
  */
-import { TalerErrorCode, TalerErrorDetails } from "@gnu-taler/taler-util";
-import { VNode, h, Fragment } from "preact";
+import { TalerErrorDetails } from "@gnu-taler/taler-util";
+import { Fragment, h, VNode } from "preact";
 import { useState } from "preact/hooks";
 import arrowDown from "../../static/img/chevron-down.svg";
 import { useDevContext } from "../context/devContext";
@@ -45,20 +45,23 @@ export function ErrorTalerOperation({
               setShowErrorDetail((v) => !v);
             }}
           >
-            <img style={{ height: "1.5em" }} src={arrowDown} />
+            <img
+              style={{
+                transform: !showErrorDetail ? undefined : "scaleY(-1)",
+                height: "1.5em",
+              }}
+              src={arrowDown}
+            />
           </button>
         )}
       </div>
       {showErrorDetail && (
         <Fragment>
           <div style={{ padding: 5, textAlign: "left" }}>
-            <div>{error.message}</div>
-          </div>
-          {errorHint && (
-            <div style={{ padding: 5, textAlign: "left" }}>
-              <div>{errorHint}</div>
+            <div>
+              <b>{error.message}</b> {!errorHint ? "" : `: ${errorHint}`}{" "}
             </div>
-          )}
+          </div>
           {devMode && (
             <div style={{ textAlign: "left", overflowX: "auto" }}>
               <pre>{JSON.stringify(error, undefined, 2)}</pre>
diff --git a/packages/taler-wallet-webextension/src/components/Loading.tsx 
b/packages/taler-wallet-webextension/src/components/LoadingError.tsx
similarity index 60%
copy from packages/taler-wallet-webextension/src/components/Loading.tsx
copy to packages/taler-wallet-webextension/src/components/LoadingError.tsx
index 34edac55..6f572b88 100644
--- a/packages/taler-wallet-webextension/src/components/Loading.tsx
+++ b/packages/taler-wallet-webextension/src/components/LoadingError.tsx
@@ -14,7 +14,17 @@
  TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
  */
 import { h, VNode } from "preact";
+import { HookError } from "../hooks/useAsyncAsHook";
+import { ErrorMessage } from "./ErrorMessage";
+import { ErrorTalerOperation } from "./ErrorTalerOperation";
 
-export function Loading(): VNode {
-  return <div>Loading...</div>;
+export interface Props {
+  title: string;
+  error: HookError;
+}
+export function LoadingError({ title, error }: Props): VNode {
+  if (error.operational) {
+    return <ErrorTalerOperation title={title} error={error.details} />;
+  }
+  return <ErrorMessage title={title} description={error.message} />;
 }
diff --git 
a/packages/taler-wallet-webextension/src/components/TransactionItem.tsx 
b/packages/taler-wallet-webextension/src/components/TransactionItem.tsx
index 68a4f8fa..206dcb0c 100644
--- a/packages/taler-wallet-webextension/src/components/TransactionItem.tsx
+++ b/packages/taler-wallet-webextension/src/components/TransactionItem.tsx
@@ -127,7 +127,7 @@ export function TransactionItem(props: {
 
 function TransactionLayout(props: TransactionLayoutProps): VNode {
   return (
-    <HistoryRow href={Pages.transaction.replace(":tid", props.id)}>
+    <HistoryRow href={Pages.balance_transaction.replace(":tid", props.id)}>
       <img src={props.iconPath} />
       <Column>
         <LargeText>
diff --git a/packages/taler-wallet-webextension/src/cta/Deposit.tsx 
b/packages/taler-wallet-webextension/src/cta/Deposit.tsx
index 3696b0c2..39ccdbac 100644
--- a/packages/taler-wallet-webextension/src/cta/Deposit.tsx
+++ b/packages/taler-wallet-webextension/src/cta/Deposit.tsx
@@ -29,7 +29,6 @@ import {
   Amounts,
   amountToPretty,
   ConfirmPayResult,
-  ConfirmPayResultDone,
   ConfirmPayResultType,
   ContractTerms,
   i18n,
@@ -174,11 +173,8 @@ export interface PaymentRequestViewProps {
   balance: AmountJson | undefined;
 }
 export function PaymentRequestView({
-  uri,
   payStatus,
   payResult,
-  onClick,
-  balance,
 }: PaymentRequestViewProps): VNode {
   let totalFees: AmountJson = Amounts.getZero(payStatus.amountRaw);
   const contractTerms: ContractTerms = payStatus.contractTerms;
diff --git a/packages/taler-wallet-webextension/src/cta/Pay.tsx 
b/packages/taler-wallet-webextension/src/cta/Pay.tsx
index 6e73b556..c0fcca16 100644
--- a/packages/taler-wallet-webextension/src/cta/Pay.tsx
+++ b/packages/taler-wallet-webextension/src/cta/Pay.tsx
@@ -40,14 +40,14 @@ import {
 } from "@gnu-taler/taler-util";
 import { OperationFailedError } from "@gnu-taler/taler-wallet-core";
 import { Fragment, h, VNode } from "preact";
-import { useEffect, useState } from "preact/hooks";
-import { ErrorTalerOperation } from "../components/ErrorTalerOperation";
+import { useState } from "preact/hooks";
+import { Loading } from "../components/Loading";
+import { LoadingError } from "../components/LoadingError";
 import { LogoHeader } from "../components/LogoHeader";
 import { Part } from "../components/Part";
 import { QR } from "../components/QR";
 import {
   ButtonSuccess,
-  ErrorBox,
   LinkSuccess,
   SmallLightText,
   SuccessBox,
@@ -84,10 +84,8 @@ const doPayment = async (
 export function PayPage({
   talerPayUri,
   goToWalletManualWithdraw,
+  goBack,
 }: Props): VNode {
-  const [payStatus, setPayStatus] = useState<PreparePayResult | undefined>(
-    undefined,
-  );
   const [payResult, setPayResult] = useState<ConfirmPayResult | undefined>(
     undefined,
   );
@@ -95,83 +93,33 @@ export function PayPage({
     OperationFailedError | string | undefined
   >(undefined);
 
-  const balance = useAsyncAsHook(wxApi.getBalance, [
-    NotificationType.CoinWithdrawn,
-  ]);
-  const balanceWithoutError = balance?.hasError
-    ? []
-    : balance?.response.balances || [];
+  const hook = useAsyncAsHook(async () => {
+    if (!talerPayUri) throw Error("Missing pay uri");
+    const payStatus = await wxApi.preparePay(talerPayUri);
+    const balance = await wxApi.getBalance();
+    return { payStatus, balance };
+  }, [NotificationType.CoinWithdrawn]);
+
+  if (!hook) {
+    return <Loading />;
+  }
+
+  if (hook.hasError) {
+    return <LoadingError title="Could not load pay status" error={hook} />;
+  }
 
-  const foundBalance = balanceWithoutError.find(
+  const foundBalance = hook.response.balance.balances.find(
     (b) =>
-      payStatus &&
       Amounts.parseOrThrow(b.available).currency ===
-        Amounts.parseOrThrow(payStatus?.amountRaw).currency,
+      Amounts.parseOrThrow(hook.response.payStatus.amountRaw).currency,
   );
   const foundAmount = foundBalance
     ? Amounts.parseOrThrow(foundBalance.available)
     : undefined;
-  // We use a string here so that dependency tracking for useEffect works 
properly
-  const foundAmountStr = foundAmount
-    ? Amounts.stringify(foundAmount)
-    : undefined;
-
-  useEffect(() => {
-    if (!talerPayUri) return;
-    const doFetch = async (): Promise<void> => {
-      try {
-        const p = await wxApi.preparePay(talerPayUri);
-        setPayStatus(p);
-      } catch (e) {
-        console.log("Got error while trying to pay", e);
-        if (e instanceof OperationFailedError) {
-          setPayErrMsg(e);
-        }
-        if (e instanceof Error) {
-          setPayErrMsg(e.message);
-        }
-      }
-    };
-    doFetch();
-  }, [talerPayUri, foundAmountStr]);
-
-  if (!talerPayUri) {
-    return <span>missing pay uri</span>;
-  }
-
-  if (!payStatus) {
-    if (payErrMsg instanceof OperationFailedError) {
-      return (
-        <WalletAction>
-          <LogoHeader />
-          <h2>{i18n.str`Digital cash payment`}</h2>
-          <section>
-            <ErrorTalerOperation
-              title="Could not get the payment information for this order"
-              error={payErrMsg?.operationError}
-            />
-          </section>
-        </WalletAction>
-      );
-    }
-    if (payErrMsg) {
-      return (
-        <WalletAction>
-          <LogoHeader />
-          <h2>{i18n.str`Digital cash payment`}</h2>
-          <section>
-            <p>Could not get the payment information for this order</p>
-            <ErrorBox>{payErrMsg}</ErrorBox>
-          </section>
-        </WalletAction>
-      );
-    }
-    return <span>Loading payment information ...</span>;
-  }
 
   const onClick = async (): Promise<void> => {
     try {
-      const res = await doPayment(payStatus);
+      const res = await doPayment(hook.response.payStatus);
       setPayResult(res);
     } catch (e) {
       console.error(e);
@@ -183,8 +131,8 @@ export function PayPage({
 
   return (
     <PaymentRequestView
-      uri={talerPayUri}
-      payStatus={payStatus}
+      uri={talerPayUri!}
+      payStatus={hook.response.payStatus}
       payResult={payResult}
       onClick={onClick}
       goToWalletManualWithdraw={goToWalletManualWithdraw}
diff --git a/packages/taler-wallet-webextension/src/cta/Withdraw.tsx 
b/packages/taler-wallet-webextension/src/cta/Withdraw.tsx
index 0a06bd57..a4ee640c 100644
--- a/packages/taler-wallet-webextension/src/cta/Withdraw.tsx
+++ b/packages/taler-wallet-webextension/src/cta/Withdraw.tsx
@@ -30,6 +30,8 @@ import {
 } from "@gnu-taler/taler-util";
 import { Fragment, h, VNode } from "preact";
 import { useState } from "preact/hooks";
+import { Loading } from "../components/Loading";
+import { LoadingError } from "../components/LoadingError";
 import { LogoHeader } from "../components/LogoHeader";
 import { Part } from "../components/Part";
 import { SelectList } from "../components/SelectList";
@@ -237,19 +239,14 @@ export function WithdrawPageWithParsedURI({
   });
 
   if (!detailsHook) {
-    return (
-      <span>
-        <i18n.Translate>Getting withdrawal details.</i18n.Translate>
-      </span>
-    );
+    return <Loading />;
   }
   if (detailsHook.hasError) {
     return (
-      <span>
-        <i18n.Translate>
-          Problems getting details: {detailsHook.message}
-        </i18n.Translate>
-      </span>
+      <LoadingError
+        title="Could not load the withdrawal details"
+        error={detailsHook}
+      />
     );
   }
 
@@ -315,21 +312,17 @@ export function WithdrawPage({ talerWithdrawUri }: 
Props): VNode {
     );
   }
   if (!uriInfoHook) {
-    return (
-      <span>
-        <i18n.Translate>Loading...</i18n.Translate>
-      </span>
-    );
+    return <Loading />;
   }
   if (uriInfoHook.hasError) {
     return (
-      <span>
-        <i18n.Translate>
-          This URI is not valid anymore: {uriInfoHook.message}
-        </i18n.Translate>
-      </span>
+      <LoadingError
+        title="Could not get the info from the URI"
+        error={uriInfoHook}
+      />
     );
   }
+
   return (
     <WithdrawPageWithParsedURI
       uri={talerWithdrawUri}
diff --git a/packages/taler-wallet-webextension/src/hooks/useAsyncAsHook.ts 
b/packages/taler-wallet-webextension/src/hooks/useAsyncAsHook.ts
index e9f03d0f..6efa1d18 100644
--- a/packages/taler-wallet-webextension/src/hooks/useAsyncAsHook.ts
+++ b/packages/taler-wallet-webextension/src/hooks/useAsyncAsHook.ts
@@ -13,20 +13,30 @@
  You should have received a copy of the GNU General Public License along with
  TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
  */
-import { NotificationType } from "@gnu-taler/taler-util";
+import { NotificationType, TalerErrorDetails } from "@gnu-taler/taler-util";
 import { useEffect, useState } from "preact/hooks";
 import * as wxApi from "../wxApi";
+import { OperationFailedError } from "@gnu-taler/taler-wallet-core";
 
 interface HookOk<T> {
   hasError: false;
   response: T;
 }
 
-interface HookError {
+export type HookError = HookGenericError | HookOperationalError
+
+export interface HookGenericError {
   hasError: true;
+  operational: false,
   message: string;
 }
 
+export interface HookOperationalError {
+  hasError: true;
+  operational: true,
+  details: TalerErrorDetails;
+}
+
 export type HookResponse<T> = HookOk<T> | HookError | undefined;
 
 //"withdraw-group-finished"
@@ -41,8 +51,10 @@ export function useAsyncAsHook<T>(
         const response = await fn();
         setHookResponse({ hasError: false, response });
       } catch (e) {
-        if (e instanceof Error) {
-          setHookResponse({ hasError: true, message: e.message });
+        if (e instanceof OperationFailedError) {
+          setHookResponse({ hasError: true, operational: true, details: 
e.operationError });
+        } else if (e instanceof Error) {
+          setHookResponse({ hasError: true, operational: false, message: 
e.message });
         }
       }
     }
diff --git a/packages/taler-wallet-webextension/src/hooks/useBackupStatus.ts 
b/packages/taler-wallet-webextension/src/hooks/useBackupStatus.ts
deleted file mode 100644
index df1e8267..00000000
--- a/packages/taler-wallet-webextension/src/hooks/useBackupStatus.ts
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- This file is part of GNU Taler
- (C) 2021 Taler Systems S.A.
-
- GNU Taler is free software; you can redistribute it and/or modify it under the
- terms of the GNU General Public License as published by the Free Software
- Foundation; either version 3, or (at your option) any later version.
-
- GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
- A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along with
- GNU Taler; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
- */
-
-import {
-  ProviderInfo,
-  ProviderPaymentPaid,
-  ProviderPaymentStatus,
-  ProviderPaymentType,
-} from "@gnu-taler/taler-wallet-core";
-import { useEffect, useState } from "preact/hooks";
-import * as wxApi from "../wxApi";
-
-export interface BackupStatus {
-  deviceName: string;
-  providers: ProviderInfo[];
-  sync: () => Promise<void>;
-}
-
-function getStatusTypeOrder(t: ProviderPaymentStatus) {
-  return [
-    ProviderPaymentType.InsufficientBalance,
-    ProviderPaymentType.TermsChanged,
-    ProviderPaymentType.Unpaid,
-    ProviderPaymentType.Paid,
-    ProviderPaymentType.Pending,
-  ].indexOf(t.type);
-}
-
-function getStatusPaidOrder(a: ProviderPaymentPaid, b: ProviderPaymentPaid) {
-  return a.paidUntil.t_ms === "never"
-    ? -1
-    : b.paidUntil.t_ms === "never"
-      ? 1
-      : a.paidUntil.t_ms - b.paidUntil.t_ms;
-}
-
-export function useBackupStatus(): BackupStatus | undefined {
-  const [status, setStatus] = useState<BackupStatus | undefined>(undefined);
-
-  useEffect(() => {
-    async function run() {
-      //create a first list of backup info by currency
-      const status = await wxApi.getBackupInfo();
-
-      const providers = status.providers.sort((a, b) => {
-        if (
-          a.paymentStatus.type === ProviderPaymentType.Paid &&
-          b.paymentStatus.type === ProviderPaymentType.Paid
-        ) {
-          return getStatusPaidOrder(a.paymentStatus, b.paymentStatus);
-        }
-        return (
-          getStatusTypeOrder(a.paymentStatus) -
-          getStatusTypeOrder(b.paymentStatus)
-        );
-      });
-
-      async function sync() {
-        await wxApi.syncAllProviders();
-      }
-
-      setStatus({ deviceName: status.deviceId, providers, sync });
-    }
-    run();
-  }, []);
-
-  return status;
-}
diff --git 
a/packages/taler-wallet-webextension/src/hooks/useExtendedPermissions.ts 
b/packages/taler-wallet-webextension/src/hooks/useExtendedPermissions.ts
index aaab0aa4..12a913b1 100644
--- a/packages/taler-wallet-webextension/src/hooks/useExtendedPermissions.ts
+++ b/packages/taler-wallet-webextension/src/hooks/useExtendedPermissions.ts
@@ -17,16 +17,13 @@
 import { useState, useEffect } from "preact/hooks";
 import * as wxApi from "../wxApi";
 import { getPermissionsApi } from "../compat";
-import { extendedPermissions } from "../permissions";
+import { getReadRequestPermissions } from "../permissions";
 
 export function useExtendedPermissions(): [boolean, () => void] {
   const [enabled, setEnabled] = useState(false);
 
   const toggle = () => {
-    setEnabled((v) => !v);
-    handleExtendedPerm(enabled).then((result) => {
-      setEnabled(result);
-    });
+    handleExtendedPerm(enabled, setEnabled)
   };
 
   useEffect(() => {
@@ -39,30 +36,22 @@ export function useExtendedPermissions(): [boolean, () => 
void] {
   return [enabled, toggle];
 }
 
-async function handleExtendedPerm(isEnabled: boolean): Promise<boolean> {
-  let nextVal: boolean | undefined;
-
+function handleExtendedPerm(isEnabled: boolean, onChange: (value: boolean) => 
void): void {
   if (!isEnabled) {
-    const granted = await new Promise<boolean>((resolve, reject) => {
-      // We set permissions here, since apparently FF wants this to be done
-      // as the result of an input event ...
-      getPermissionsApi().request(extendedPermissions, (granted: boolean) => {
-        if (chrome.runtime.lastError) {
-          console.error("error requesting permissions");
-          console.error(chrome.runtime.lastError);
-          reject(chrome.runtime.lastError);
-          return;
-        }
-        console.log("permissions granted:", granted);
-        resolve(granted);
-      });
+    // We set permissions here, since apparently FF wants this to be done
+    // as the result of an input event ...
+    getPermissionsApi().request(getReadRequestPermissions(), async (granted: 
boolean) => {
+      if (chrome.runtime.lastError) {
+        console.error("error requesting permissions");
+        console.error(chrome.runtime.lastError);
+        onChange(false);
+        return;
+      }
+      console.log("permissions granted:", granted);
+      const res = await wxApi.setExtendedPermissions(granted);
+      onChange(res.newValue);
     });
-    const res = await wxApi.setExtendedPermissions(granted);
-    nextVal = res.newValue;
   } else {
-    const res = await wxApi.setExtendedPermissions(false);
-    nextVal = res.newValue;
+    wxApi.setExtendedPermissions(false).then(r => onChange(r.newValue));
   }
-  console.log("new permissions applied:", nextVal ?? false);
-  return nextVal ?? false;
 }
diff --git a/packages/taler-wallet-webextension/src/permissions.ts 
b/packages/taler-wallet-webextension/src/permissions.ts
index 909433bb..fe863080 100644
--- a/packages/taler-wallet-webextension/src/permissions.ts
+++ b/packages/taler-wallet-webextension/src/permissions.ts
@@ -14,7 +14,7 @@
  GNU Taler; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
  */
 
-export const extendedPermissions = {
+export const getReadRequestPermissions = () => ({
   permissions: ["webRequest"],
   origins: ["http://*/*";, "https://*/*";],
-};
+})
\ No newline at end of file
diff --git a/packages/taler-wallet-webextension/src/popup/BalancePage.tsx 
b/packages/taler-wallet-webextension/src/popup/BalancePage.tsx
index 014d3b18..a5f24470 100644
--- a/packages/taler-wallet-webextension/src/popup/BalancePage.tsx
+++ b/packages/taler-wallet-webextension/src/popup/BalancePage.tsx
@@ -17,12 +17,13 @@
 import { Amounts, Balance, i18n } from "@gnu-taler/taler-util";
 import { Fragment, h, VNode } from "preact";
 import { BalanceTable } from "../components/BalanceTable";
-import { ButtonPrimary, ErrorBox } from "../components/styled";
+import { Loading } from "../components/Loading";
+import { LoadingError } from "../components/LoadingError";
+import { MultiActionButton } from "../components/MultiActionButton";
+import { ButtonPrimary } from "../components/styled";
 import { useAsyncAsHook } from "../hooks/useAsyncAsHook";
 import { PageLink } from "../renderHtml";
 import * as wxApi from "../wxApi";
-import { MultiActionButton } from "../components/MultiActionButton";
-import { Loading } from "../components/Loading";
 
 interface Props {
   goToWalletDeposit: (currency: string) => void;
@@ -42,15 +43,7 @@ export function BalancePage({
   }
 
   if (state.hasError) {
-    return (
-      <Fragment>
-        <ErrorBox>{state.message}</ErrorBox>
-        <p>
-          Click <PageLink pageName="welcome">here</PageLink> for help and
-          diagnostics.
-        </p>
-      </Fragment>
-    );
+    return <LoadingError title="Could not load balance page" error={state} />;
   }
 
   return (
diff --git a/packages/taler-wallet-webextension/src/popupEntryPoint.tsx 
b/packages/taler-wallet-webextension/src/popupEntryPoint.tsx
index ecb49b01..f7174c3c 100644
--- a/packages/taler-wallet-webextension/src/popupEntryPoint.tsx
+++ b/packages/taler-wallet-webextension/src/popupEntryPoint.tsx
@@ -98,7 +98,7 @@ function Application(): VNode {
                 component={BalancePage}
                 goToWalletManualWithdraw={() =>
                   goToWalletPage(
-                    Pages.manual_withdraw.replace(":currency?", ""),
+                    Pages.balance_manual_withdraw.replace(":currency?", ""),
                   )
                 }
                 goToWalletHistory={(currency: string) =>
@@ -128,9 +128,9 @@ function Application(): VNode {
               <Route path={Pages.last_activity} component={LastActivityPage} />
 
               <Route
-                path={Pages.transaction}
+                path={Pages.balance_transaction}
                 component={({ tid }: { tid: string }) =>
-                  goToWalletPage(Pages.transaction.replace(":tid", tid))
+                  goToWalletPage(Pages.balance_transaction.replace(":tid", 
tid))
                 }
               />
 
@@ -138,18 +138,18 @@ function Application(): VNode {
                 path={Pages.backup}
                 component={BackupPage}
                 onAddProvider={() => {
-                  route(Pages.provider_add);
+                  route(Pages.backup_provider_add);
                 }}
               />
               <Route
-                path={Pages.provider_detail}
+                path={Pages.backup_provider_detail}
                 component={ProviderDetailPage}
                 onBack={() => {
                   route(Pages.backup);
                 }}
               />
               <Route
-                path={Pages.provider_add}
+                path={Pages.backup_provider_add}
                 component={ProviderAddPage}
                 onBack={() => {
                   route(Pages.backup);
@@ -157,7 +157,7 @@ function Application(): VNode {
               />
 
               <Route
-                path={Pages.exchange_add}
+                path={Pages.settings_exchange_add}
                 component={ExchangeAddPage}
                 onBack={() => {
                   route(Pages.balance);
diff --git a/packages/taler-wallet-webextension/src/utils/index.ts 
b/packages/taler-wallet-webextension/src/utils/index.ts
index 55898d18..cef0595d 100644
--- a/packages/taler-wallet-webextension/src/utils/index.ts
+++ b/packages/taler-wallet-webextension/src/utils/index.ts
@@ -193,19 +193,19 @@ export function actionForTalerUri(
 ): string | undefined {
   switch (uriType) {
     case TalerUriType.TalerWithdraw:
-      return makeExtensionUrlWithParams("static/wallet.html#/withdraw", {
+      return makeExtensionUrlWithParams("static/wallet.html#/cta/withdraw", {
         talerWithdrawUri: talerUri,
       });
     case TalerUriType.TalerPay:
-      return makeExtensionUrlWithParams("static/wallet.html#/pay", {
+      return makeExtensionUrlWithParams("static/wallet.html#/cta/pay", {
         talerPayUri: talerUri,
       });
     case TalerUriType.TalerTip:
-      return makeExtensionUrlWithParams("static/wallet.html#/tip", {
+      return makeExtensionUrlWithParams("static/wallet.html#/cta/tip", {
         talerTipUri: talerUri,
       });
     case TalerUriType.TalerRefund:
-      return makeExtensionUrlWithParams("static/wallet.html#/refund", {
+      return makeExtensionUrlWithParams("static/wallet.html#/cta/refund", {
         talerRefundUri: talerUri,
       });
     case TalerUriType.TalerNotifyReserve:
diff --git a/packages/taler-wallet-webextension/src/wallet/BackupPage.tsx 
b/packages/taler-wallet-webextension/src/wallet/BackupPage.tsx
index 0b0af25a..daea9e3b 100644
--- a/packages/taler-wallet-webextension/src/wallet/BackupPage.tsx
+++ b/packages/taler-wallet-webextension/src/wallet/BackupPage.tsx
@@ -17,7 +17,9 @@
 import { i18n, Timestamp } from "@gnu-taler/taler-util";
 import {
   ProviderInfo,
+  ProviderPaymentPaid,
   ProviderPaymentStatus,
+  ProviderPaymentType,
 } from "@gnu-taler/taler-wallet-core";
 import {
   differenceInMonths,
@@ -25,6 +27,8 @@ import {
   intervalToDuration,
 } from "date-fns";
 import { Fragment, h, VNode } from "preact";
+import { Loading } from "../components/Loading";
+import { LoadingError } from "../components/LoadingError";
 import {
   BoldLight,
   ButtonPrimary,
@@ -36,23 +40,58 @@ import {
   SmallLightText,
   SmallText,
 } from "../components/styled";
-import { useBackupStatus } from "../hooks/useBackupStatus";
+import { useAsyncAsHook } from "../hooks/useAsyncAsHook";
 import { Pages } from "../NavigationBar";
+import * as wxApi from "../wxApi";
 
 interface Props {
   onAddProvider: () => void;
 }
 
+// interface BackupStatus {
+//   deviceName: string;
+//   providers: ProviderInfo[];
+// }
+
+// async function getBackupInfoOrdered(): BackupStatus {
+//   //create a first list of backup info by currency
+//   const status = await wxApi.getBackupInfo();
+
+//   return { deviceName: status.deviceId, providers };
+// }
+
+// async function sync() {
+//   await wxApi.syncAllProviders();
+// }
+
 export function BackupPage({ onAddProvider }: Props): VNode {
-  const status = useBackupStatus();
+  const status = useAsyncAsHook(wxApi.getBackupInfo);
   if (!status) {
-    return <div>Loading...</div>;
+    return <Loading />;
+  }
+  if (status.hasError) {
+    return (
+      <LoadingError title="Could not load backup providers" error={status} />
+    );
   }
+
+  const providers = status.response.providers.sort((a, b) => {
+    if (
+      a.paymentStatus.type === ProviderPaymentType.Paid &&
+      b.paymentStatus.type === ProviderPaymentType.Paid
+    ) {
+      return getStatusPaidOrder(a.paymentStatus, b.paymentStatus);
+    }
+    return (
+      getStatusTypeOrder(a.paymentStatus) - getStatusTypeOrder(b.paymentStatus)
+    );
+  });
+
   return (
     <BackupView
-      providers={status.providers}
+      providers={providers}
       onAddProvider={onAddProvider}
-      onSyncAll={status.sync}
+      onSyncAll={wxApi.syncAllProviders}
     />
   );
 }
@@ -128,7 +167,7 @@ function BackupLayout(props: TransactionLayoutProps): VNode 
{
     <RowBorderGray>
       <div style={{ color: !props.active ? "grey" : undefined }}>
         <a
-          href={Pages.provider_detail.replace(
+          href={Pages.backup_provider_detail.replace(
             ":pid",
             encodeURIComponent(props.id),
           )}
@@ -194,3 +233,21 @@ function daysUntil(d: Timestamp): string {
   });
   return `${str}`;
 }
+
+function getStatusTypeOrder(t: ProviderPaymentStatus) {
+  return [
+    ProviderPaymentType.InsufficientBalance,
+    ProviderPaymentType.TermsChanged,
+    ProviderPaymentType.Unpaid,
+    ProviderPaymentType.Paid,
+    ProviderPaymentType.Pending,
+  ].indexOf(t.type);
+}
+
+function getStatusPaidOrder(a: ProviderPaymentPaid, b: ProviderPaymentPaid) {
+  return a.paidUntil.t_ms === "never"
+    ? -1
+    : b.paidUntil.t_ms === "never"
+    ? 1
+    : a.paidUntil.t_ms - b.paidUntil.t_ms;
+}
diff --git a/packages/taler-wallet-webextension/src/wallet/BalancePage.tsx 
b/packages/taler-wallet-webextension/src/wallet/BalancePage.tsx
index 5fa08f8a..111ac86c 100644
--- a/packages/taler-wallet-webextension/src/wallet/BalancePage.tsx
+++ b/packages/taler-wallet-webextension/src/wallet/BalancePage.tsx
@@ -18,13 +18,9 @@ import { Amounts, Balance, i18n } from 
"@gnu-taler/taler-util";
 import { Fragment, h, VNode } from "preact";
 import { BalanceTable } from "../components/BalanceTable";
 import { Loading } from "../components/Loading";
+import { LoadingError } from "../components/LoadingError";
 import { MultiActionButton } from "../components/MultiActionButton";
-import {
-  ButtonPrimary,
-  Centered,
-  ErrorBox,
-  SuccessBox,
-} from "../components/styled";
+import { ButtonPrimary, Centered } from "../components/styled";
 import { useAsyncAsHook } from "../hooks/useAsyncAsHook";
 import { PageLink } from "../renderHtml";
 import * as wxApi from "../wxApi";
@@ -49,15 +45,7 @@ export function BalancePage({
   }
 
   if (state.hasError) {
-    return (
-      <Fragment>
-        <ErrorBox>{state.message}</ErrorBox>
-        <p>
-          Click <PageLink pageName="welcome">here</PageLink> for help and
-          diagnostics.
-        </p>
-      </Fragment>
-    );
+    return <LoadingError title="Could not load balance page" error={state} />;
   }
 
   return (
diff --git a/packages/taler-wallet-webextension/src/wallet/ExchangeSetUrl.tsx 
b/packages/taler-wallet-webextension/src/wallet/ExchangeSetUrl.tsx
index f346d6bf..d8e46cc4 100644
--- a/packages/taler-wallet-webextension/src/wallet/ExchangeSetUrl.tsx
+++ b/packages/taler-wallet-webextension/src/wallet/ExchangeSetUrl.tsx
@@ -1,6 +1,5 @@
 import {
   canonicalizeBaseUrl,
-  ExchangeListItem,
   i18n,
   TalerConfigResponse,
 } from "@gnu-taler/taler-util";
diff --git a/packages/taler-wallet-webextension/src/wallet/History.tsx 
b/packages/taler-wallet-webextension/src/wallet/History.tsx
index 7912d169..a295ca28 100644
--- a/packages/taler-wallet-webextension/src/wallet/History.tsx
+++ b/packages/taler-wallet-webextension/src/wallet/History.tsx
@@ -23,12 +23,12 @@ import {
 import { Fragment, h, VNode } from "preact";
 import { useState } from "preact/hooks";
 import { Loading } from "../components/Loading";
+import { LoadingError } from "../components/LoadingError";
 import {
   ButtonBoxPrimary,
   ButtonBoxWarning,
   ButtonPrimary,
   DateSeparator,
-  ErrorBox,
   NiceSelect,
   WarningBox,
 } from "../components/styled";
@@ -62,10 +62,10 @@ export function HistoryPage({
 
   if (transactionQuery.hasError) {
     return (
-      <Fragment>
-        <ErrorBox>{transactionQuery.message}</ErrorBox>
-        <p>There was an error loading the transactions.</p>
-      </Fragment>
+      <LoadingError
+        title="Could not load the list of transactions"
+        error={transactionQuery}
+      />
     );
   }
 
diff --git 
a/packages/taler-wallet-webextension/src/wallet/ManualWithdrawPage.tsx 
b/packages/taler-wallet-webextension/src/wallet/ManualWithdrawPage.tsx
index c7958eb8..86c3c145 100644
--- a/packages/taler-wallet-webextension/src/wallet/ManualWithdrawPage.tsx
+++ b/packages/taler-wallet-webextension/src/wallet/ManualWithdrawPage.tsx
@@ -14,23 +14,23 @@
  TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
 */
 
-import { VNode, h, Fragment } from "preact";
-import { useState } from "preact/hooks";
-import { CreateManualWithdraw } from "./CreateManualWithdraw";
-import * as wxApi from "../wxApi";
 import {
   AcceptManualWithdrawalResult,
   AmountJson,
   Amounts,
   NotificationType,
 } from "@gnu-taler/taler-util";
-import { ReserveCreated } from "./ReserveCreated";
+import { h, VNode } from "preact";
 import { route } from "preact-router";
-import { Pages } from "../NavigationBar";
+import { useState } from "preact/hooks";
+import { Loading } from "../components/Loading";
+import { LoadingError } from "../components/LoadingError";
 import { useAsyncAsHook } from "../hooks/useAsyncAsHook";
+import { Pages } from "../NavigationBar";
+import * as wxApi from "../wxApi";
+import { CreateManualWithdraw } from "./CreateManualWithdraw";
 import { ExchangeAddPage } from "./ExchangeAddPage";
-import { Loading } from "../components/Loading";
-import { ErrorBox } from "../components/styled";
+import { ReserveCreated } from "./ReserveCreated";
 
 export function ManualWithdrawPage({ currency }: { currency?: string }): VNode 
{
   const [success, setSuccess] = useState<
@@ -92,12 +92,13 @@ export function ManualWithdrawPage({ currency }: { 
currency?: string }): VNode {
   }
   if (state.hasError) {
     return (
-      <Fragment>
-        <ErrorBox>{state.message}</ErrorBox>
-        <p>There was an error getting the known exchanges</p>
-      </Fragment>
+      <LoadingError
+        title="Could not load the list of known exchanges"
+        error={state}
+      />
     );
   }
+
   const exchangeList = state.response.exchanges.reduce(
     (p, c) => ({
       ...p,
diff --git a/packages/taler-wallet-webextension/src/wallet/Settings.tsx 
b/packages/taler-wallet-webextension/src/wallet/Settings.tsx
index 29344878..ff47620e 100644
--- a/packages/taler-wallet-webextension/src/wallet/Settings.tsx
+++ b/packages/taler-wallet-webextension/src/wallet/Settings.tsx
@@ -142,7 +142,9 @@ export function SettingsView({
         )}
         <div style={{ display: "flex", justifyContent: "space-between" }}>
           <div />
-          <LinkPrimary href={Pages.exchange_add}>Add an exchange</LinkPrimary>
+          <LinkPrimary href={Pages.settings_exchange_add}>
+            Add an exchange
+          </LinkPrimary>
         </div>
 
         <h2>Config</h2>
diff --git a/packages/taler-wallet-webextension/src/walletEntryPoint.tsx 
b/packages/taler-wallet-webextension/src/walletEntryPoint.tsx
index 978d6fde..dbcf053e 100644
--- a/packages/taler-wallet-webextension/src/walletEntryPoint.tsx
+++ b/packages/taler-wallet-webextension/src/walletEntryPoint.tsx
@@ -22,7 +22,7 @@
 
 import { setupI18n } from "@gnu-taler/taler-util";
 import { createHashHistory } from "history";
-import { h, render, VNode } from "preact";
+import { Fragment, h, render, VNode } from "preact";
 import Router, { route, Route } from "preact-router";
 import Match from "preact-router/match";
 import { useEffect, useState } from "preact/hooks";
@@ -78,37 +78,60 @@ function Application(): VNode {
     string | undefined
   >(undefined);
   const hash_history = createHashHistory();
+  function clearNotification(): void {
+    setGlobalNotification(undefined);
+  }
   return (
     <div>
       <DevContextProvider>
         {({ devMode }: { devMode: boolean }) => (
           <IoCProviderForRuntime>
-            <LogoHeader />
             {/* <Match/> won't work in the first render if <Router /> is not 
called first */}
             {/* https://github.com/preactjs/preact-router/issues/415 */}
             <Router history={hash_history} />
             <Match>
-              {({ path }: { path: string }) => (
-                <NavBar devMode={devMode} path={path} />
-              )}
+              {({ path }: { path: string }) => {
+                if (path && path.startsWith("/cta")) return;
+                return (
+                  <Fragment>
+                    <LogoHeader />
+                    <NavBar devMode={devMode} path={path} />
+                  </Fragment>
+                );
+              }}
             </Match>
             <WalletBox>
               {globalNotification && (
-                <SuccessBox onClick={() => setGlobalNotification(undefined)}>
+                <SuccessBox onClick={clearNotification}>
                   <div>{globalNotification}</div>
                 </SuccessBox>
               )}
-              <Router history={hash_history}>
+              <Router
+                history={hash_history}
+                onChange={() => {
+                  // const movingOutFromNotification =
+                  //   globalNotification && e.url !== globalNotification.to;
+                  if (globalNotification) {
+                    setGlobalNotification(undefined);
+                  }
+                }}
+              >
                 <Route path={Pages.welcome} component={WelcomePage} />
 
+                {/**
+                 * BALANCE
+                 */}
+
                 <Route
                   path={Pages.balance}
                   component={BalancePage}
                   goToWalletManualWithdraw={() =>
-                    route(Pages.manual_withdraw.replace(":currency?", ""))
+                    route(
+                      Pages.balance_manual_withdraw.replace(":currency?", ""),
+                    )
                   }
                   goToWalletDeposit={(currency: string) =>
-                    route(Pages.deposit.replace(":currency", currency))
+                    route(Pages.balance_deposit.replace(":currency", currency))
                   }
                   goToWalletHistory={(currency: string) =>
                     route(Pages.balance_history.replace(":currency", currency))
@@ -118,90 +141,97 @@ function Application(): VNode {
                   path={Pages.balance_history}
                   component={HistoryPage}
                   goToWalletDeposit={(currency: string) =>
-                    route(Pages.deposit.replace(":currency", currency))
+                    route(Pages.balance_deposit.replace(":currency", currency))
                   }
                   goToWalletManualWithdraw={(currency?: string) =>
                     route(
-                      Pages.manual_withdraw.replace(
+                      Pages.balance_manual_withdraw.replace(
                         ":currency?",
                         currency || "",
                       ),
                     )
                   }
                 />
+                <Route
+                  path={Pages.balance_transaction}
+                  component={TransactionPage}
+                />
+
+                <Route
+                  path={Pages.balance_manual_withdraw}
+                  component={ManualWithdrawPage}
+                />
+
+                <Route
+                  path={Pages.balance_deposit}
+                  component={DepositPage}
+                  onSuccess={(currency: string) => {
+                    route(Pages.balance_history.replace(":currency", 
currency));
+                    setGlobalNotification(
+                      "All done, your transaction is in progress",
+                    );
+                  }}
+                />
+                {/**
+                 * LAST ACTIVITY
+                 */}
                 <Route
                   path={Pages.last_activity}
                   component={LastActivityPage}
                 />
-                <Route path={Pages.transaction} component={TransactionPage} />
                 <Route path={Pages.settings} component={SettingsPage} />
+
+                {/**
+                 * BACKUP
+                 */}
                 <Route
                   path={Pages.backup}
                   component={BackupPage}
                   onAddProvider={() => {
-                    route(Pages.provider_add);
+                    route(Pages.backup_provider_add);
                   }}
                 />
                 <Route
-                  path={Pages.provider_detail}
+                  path={Pages.backup_provider_detail}
                   component={ProviderDetailPage}
                   onBack={() => {
                     route(Pages.backup);
                   }}
                 />
                 <Route
-                  path={Pages.provider_add}
+                  path={Pages.backup_provider_add}
                   component={ProviderAddPage}
                   onBack={() => {
                     route(Pages.backup);
                   }}
                 />
 
+                {/**
+                 * SETTINGS
+                 */}
                 <Route
-                  path={Pages.exchange_add}
+                  path={Pages.settings_exchange_add}
                   component={ExchangeAddPage}
                   onBack={() => {
                     route(Pages.balance);
                   }}
                 />
 
-                <Route
-                  path={Pages.manual_withdraw}
-                  component={ManualWithdrawPage}
-                />
-
-                <Route
-                  path={Pages.deposit}
-                  component={DepositPage}
-                  onSuccess={(currency: string) => {
-                    route(Pages.balance_history.replace(":currency", 
currency));
-                    setGlobalNotification(
-                      "All done, your transaction is in progress",
-                    );
-                  }}
-                />
-                <Route
-                  path={Pages.reset_required}
-                  component={() => <div>no yet implemented</div>}
-                />
-                <Route
-                  path={Pages.payback}
-                  component={() => <div>no yet implemented</div>}
-                />
-                <Route
-                  path={Pages.return_coins}
-                  component={() => <div>no yet implemented</div>}
-                />
+                {/**
+                 * DEV
+                 */}
 
                 <Route path={Pages.dev} component={DeveloperPage} />
 
-                {/** call to action */}
+                {/**
+                 * CALL TO ACTION
+                 */}
                 <Route
-                  path={Pages.pay}
+                  path={Pages.cta_pay}
                   component={PayPage}
                   goToWalletManualWithdraw={(currency?: string) =>
                     route(
-                      Pages.manual_withdraw.replace(
+                      Pages.balance_manual_withdraw.replace(
                         ":currency?",
                         currency || "",
                       ),
@@ -209,15 +239,13 @@ function Application(): VNode {
                   }
                   goBack={() => route(Pages.balance)}
                 />
-                <Route
-                  path={Pages.pay}
-                  component={PayPage}
-                  goBack={() => route(Pages.balance)}
-                />
-                <Route path={Pages.refund} component={RefundPage} />
-                <Route path={Pages.tips} component={TipPage} />
-                <Route path={Pages.withdraw} component={WithdrawPage} />
+                <Route path={Pages.cta_refund} component={RefundPage} />
+                <Route path={Pages.cta_tips} component={TipPage} />
+                <Route path={Pages.cta_withdraw} component={WithdrawPage} />
 
+                {/**
+                 * NOT FOUND
+                 */}
                 <Route default component={Redirect} to={Pages.balance} />
               </Router>
             </WalletBox>
@@ -230,7 +258,7 @@ function Application(): VNode {
 
 function Redirect({ to }: { to: string }): null {
   useEffect(() => {
-    console.log("go some wrong route");
+    console.log("got some wrong route", to);
     route(to, true);
   });
   return null;
diff --git a/packages/taler-wallet-webextension/src/wxBackend.ts 
b/packages/taler-wallet-webextension/src/wxBackend.ts
index 412f33f1..085d7045 100644
--- a/packages/taler-wallet-webextension/src/wxBackend.ts
+++ b/packages/taler-wallet-webextension/src/wxBackend.ts
@@ -40,7 +40,7 @@ import {
 import { BrowserCryptoWorkerFactory } from "./browserCryptoWorkerFactory";
 import { BrowserHttpLib } from "./browserHttpLib";
 import { getPermissionsApi, isFirefox } from "./compat";
-import { extendedPermissions } from "./permissions";
+import { getReadRequestPermissions } from "./permissions";
 import { SynchronousCryptoWorkerFactory } from 
"./serviceWorkerCryptoWorkerFactory.js";
 import { ServiceWorkerHttpLib } from "./serviceWorkerHttpLib";
 
@@ -128,7 +128,7 @@ async function dispatch(
     }
     case "wxGetExtendedPermissions": {
       const res = await new Promise((resolve, reject) => {
-        getPermissionsApi().contains(extendedPermissions, (result: boolean) => 
{
+        getPermissionsApi().contains(getReadRequestPermissions(), (result: 
boolean) => {
           resolve(result);
         });
       });
@@ -143,7 +143,7 @@ async function dispatch(
         r = wrapResponse({ newValue: true });
       } else {
         await new Promise<void>((resolve, reject) => {
-          getPermissionsApi().remove(extendedPermissions, (rem) => {
+          getPermissionsApi().remove(getReadRequestPermissions(), (rem) => {
             console.log("permissions removed:", rem);
             resolve();
           });
@@ -339,7 +339,7 @@ function headerListener(
         switch (uriType) {
           case TalerUriType.TalerWithdraw:
             return makeSyncWalletRedirect(
-              "/static/wallet.html#/withdraw",
+              "/static/wallet.html#/cta/withdraw",
               details.tabId,
               details.url,
               {
@@ -348,7 +348,7 @@ function headerListener(
             );
           case TalerUriType.TalerPay:
             return makeSyncWalletRedirect(
-              "/static/wallet.html#/pay",
+              "/static/wallet.html#/cta/pay",
               details.tabId,
               details.url,
               {
@@ -357,7 +357,7 @@ function headerListener(
             );
           case TalerUriType.TalerTip:
             return makeSyncWalletRedirect(
-              "/static/wallet.html#/tip",
+              "/static/wallet.html#/cta/tip",
               details.tabId,
               details.url,
               {
@@ -366,7 +366,7 @@ function headerListener(
             );
           case TalerUriType.TalerRefund:
             return makeSyncWalletRedirect(
-              "/static/wallet.html#/refund",
+              "/static/wallet.html#/cta/refund",
               details.tabId,
               details.url,
               {
@@ -396,13 +396,13 @@ function headerListener(
 }
 
 function setupHeaderListener(): void {
-  if (chrome.runtime.getManifest().manifest_version === 3) {
-    console.error("cannot block request on manfest v3")
-    return
-  }
+  // if (chrome.runtime.getManifest().manifest_version === 3) {
+  //   console.error("cannot block request on manfest v3")
+  //   return
+  // }
   console.log("setting up header listener");
   // Handlers for catching HTTP requests
-  getPermissionsApi().contains(extendedPermissions, (result: boolean) => {
+  getPermissionsApi().contains(getReadRequestPermissions(), (result: boolean) 
=> {
     if (
       "webRequest" in chrome &&
       "onHeadersReceived" in chrome.webRequest &&
@@ -415,7 +415,7 @@ function setupHeaderListener(): void {
       chrome.webRequest.onHeadersReceived.addListener(
         headerListener,
         { urls: ["<all_urls>"] },
-        ["responseHeaders", "blocking"],
+        ["responseHeaders"]
       );
     }
     if ("webRequest" in chrome) {

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]