From 2a417881bb5c67cf889d54932025badf5a85a9e0 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Thu, 20 Jan 2022 13:13:53 -0300 Subject: fix permission api, grouping all cta into same path --- .../src/hooks/useAsyncAsHook.ts | 20 +++- .../src/hooks/useBackupStatus.ts | 81 -------------- .../src/hooks/useExtendedPermissions.ts | 43 +++---- .../taler-wallet-webextension/src/permissions.ts | 12 +- .../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 | 123 ++++++++++++--------- .../taler-wallet-webextension/src/wxBackend.ts | 16 +-- 15 files changed, 224 insertions(+), 237 deletions(-) delete mode 100644 packages/taler-wallet-webextension/src/hooks/useBackupStatus.ts (limited to 'packages/taler-wallet-webextension') diff --git a/packages/taler-wallet-webextension/src/hooks/useAsyncAsHook.ts b/packages/taler-wallet-webextension/src/hooks/useAsyncAsHook.ts index e9f03d0fa..6efa1d181 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 */ -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 { 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 = HookOk | HookError | undefined; //"withdraw-group-finished" @@ -41,8 +51,10 @@ export function useAsyncAsHook( 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 df1e82676..000000000 --- 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 - */ - -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; -} - -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(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 aaab0aa43..12a913b1f 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 { - let nextVal: boolean | undefined; - +function handleExtendedPerm(isEnabled: boolean, onChange: (value: boolean) => void): void { if (!isEnabled) { - const granted = await new Promise((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 909433bb8..6b6f99a8e 100644 --- a/packages/taler-wallet-webextension/src/permissions.ts +++ b/packages/taler-wallet-webextension/src/permissions.ts @@ -14,7 +14,11 @@ GNU Taler; see the file COPYING. If not, see */ -export const extendedPermissions = { - permissions: ["webRequest"], - origins: ["http://*/*", "https://*/*"], -}; +export const getReadRequestPermissions = () => + chrome.runtime.getManifest().manifest_version === 3 ? ({ + permissions: ["webRequest"], + origins: ["http://*/*", "https://*/*"], + }) : ({ + permissions: ["webRequest", "webRequestBlocking"], + origins: ["http://*/*", "https://*/*"], + }); diff --git a/packages/taler-wallet-webextension/src/popup/BalancePage.tsx b/packages/taler-wallet-webextension/src/popup/BalancePage.tsx index 014d3b18e..a5f24470e 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 ( - - {state.message} -

- Click here for help and - diagnostics. -

-
- ); + return ; } return ( diff --git a/packages/taler-wallet-webextension/src/popupEntryPoint.tsx b/packages/taler-wallet-webextension/src/popupEntryPoint.tsx index ecb49b01d..f7174c3c5 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 { - 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(Pages.backup); }} /> { route(Pages.backup); @@ -157,7 +157,7 @@ function Application(): VNode { /> { route(Pages.balance); diff --git a/packages/taler-wallet-webextension/src/utils/index.ts b/packages/taler-wallet-webextension/src/utils/index.ts index 55898d181..cef0595d3 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 0b0af25ab..daea9e3bd 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
Loading...
; + return ; + } + if (status.hasError) { + return ( + + ); } + + 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 ( ); } @@ -128,7 +167,7 @@ function BackupLayout(props: TransactionLayoutProps): VNode {
- {state.message} -

- Click here for help and - diagnostics. -

- - ); + return ; } return ( diff --git a/packages/taler-wallet-webextension/src/wallet/ExchangeSetUrl.tsx b/packages/taler-wallet-webextension/src/wallet/ExchangeSetUrl.tsx index f346d6bf3..d8e46cc46 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 7912d169a..a295ca28f 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 ( - - {transactionQuery.message} -

There was an error loading the transactions.

-
+ ); } diff --git a/packages/taler-wallet-webextension/src/wallet/ManualWithdrawPage.tsx b/packages/taler-wallet-webextension/src/wallet/ManualWithdrawPage.tsx index c7958eb8a..86c3c1456 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 */ -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 ( - - {state.message} -

There was an error getting the known exchanges

-
+ ); } + 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 293448785..ff47620eb 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({ )}
- Add an exchange + + Add an exchange +

Config

diff --git a/packages/taler-wallet-webextension/src/walletEntryPoint.tsx b/packages/taler-wallet-webextension/src/walletEntryPoint.tsx index 978d6fde5..85e38d85a 100644 --- a/packages/taler-wallet-webextension/src/walletEntryPoint.tsx +++ b/packages/taler-wallet-webextension/src/walletEntryPoint.tsx @@ -78,6 +78,9 @@ function Application(): VNode { string | undefined >(undefined); const hash_history = createHashHistory(); + function clearNotification(): void { + setGlobalNotification(undefined); + } return (
@@ -94,21 +97,36 @@ function Application(): VNode { {globalNotification && ( - setGlobalNotification(undefined)}> +
{globalNotification}
)} - + { + // const movingOutFromNotification = + // globalNotification && e.url !== globalNotification.to; + if (globalNotification) { + setGlobalNotification(undefined); + } + }} + > + {/** + * BALANCE + */} + - 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 +136,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(Pages.balance_history.replace(":currency", currency)); + setGlobalNotification( + "All done, your transaction is in progress", + ); + }} + /> + {/** + * LAST ACTIVITY + */} - + + {/** + * BACKUP + */} { - route(Pages.provider_add); + route(Pages.backup_provider_add); }} /> { route(Pages.backup); }} /> { route(Pages.backup); }} /> + {/** + * SETTINGS + */} { route(Pages.balance); }} /> - - - { - route(Pages.balance_history.replace(":currency", currency)); - setGlobalNotification( - "All done, your transaction is in progress", - ); - }} - /> -
no yet implemented
} - /> -
no yet implemented
} - /> -
no yet implemented
} - /> + {/** + * DEV + */} - {/** call to action */} + {/** + * CALL TO ACTION + */} route( - Pages.manual_withdraw.replace( + Pages.balance_manual_withdraw.replace( ":currency?", currency || "", ), @@ -209,15 +234,13 @@ function Application(): VNode { } goBack={() => route(Pages.balance)} /> - route(Pages.balance)} - /> - - - + + + + {/** + * NOT FOUND + */}
@@ -230,7 +253,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 412f33f12..3feb232d6 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((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, { @@ -402,7 +402,7 @@ function setupHeaderListener(): void { } 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 && -- cgit v1.2.3