fix: cta header, fix: do not reset ToS ETAG when getting the exchange ToS
This commit is contained in:
parent
2a417881bb
commit
0aa26448d4
@ -14,11 +14,7 @@
|
|||||||
GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
|
GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export const getReadRequestPermissions = () =>
|
export const getReadRequestPermissions = () => ({
|
||||||
chrome.runtime.getManifest().manifest_version === 3 ? ({
|
permissions: ["webRequest"],
|
||||||
permissions: ["webRequest"],
|
origins: ["http://*/*", "https://*/*"],
|
||||||
origins: ["http://*/*", "https://*/*"],
|
})
|
||||||
}) : ({
|
|
||||||
permissions: ["webRequest", "webRequestBlocking"],
|
|
||||||
origins: ["http://*/*", "https://*/*"],
|
|
||||||
});
|
|
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
import { setupI18n } from "@gnu-taler/taler-util";
|
import { setupI18n } from "@gnu-taler/taler-util";
|
||||||
import { createHashHistory } from "history";
|
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 Router, { route, Route } from "preact-router";
|
||||||
import Match from "preact-router/match";
|
import Match from "preact-router/match";
|
||||||
import { useEffect, useState } from "preact/hooks";
|
import { useEffect, useState } from "preact/hooks";
|
||||||
@ -86,14 +86,19 @@ function Application(): VNode {
|
|||||||
<DevContextProvider>
|
<DevContextProvider>
|
||||||
{({ devMode }: { devMode: boolean }) => (
|
{({ devMode }: { devMode: boolean }) => (
|
||||||
<IoCProviderForRuntime>
|
<IoCProviderForRuntime>
|
||||||
<LogoHeader />
|
|
||||||
{/* <Match/> won't work in the first render if <Router /> is not called first */}
|
{/* <Match/> won't work in the first render if <Router /> is not called first */}
|
||||||
{/* https://github.com/preactjs/preact-router/issues/415 */}
|
{/* https://github.com/preactjs/preact-router/issues/415 */}
|
||||||
<Router history={hash_history} />
|
<Router history={hash_history} />
|
||||||
<Match>
|
<Match>
|
||||||
{({ path }: { path: string }) => (
|
{({ path }: { path: string }) => {
|
||||||
<NavBar devMode={devMode} path={path} />
|
if (path && path.startsWith("/cta")) return;
|
||||||
)}
|
return (
|
||||||
|
<Fragment>
|
||||||
|
<LogoHeader />
|
||||||
|
<NavBar devMode={devMode} path={path} />
|
||||||
|
</Fragment>
|
||||||
|
);
|
||||||
|
}}
|
||||||
</Match>
|
</Match>
|
||||||
<WalletBox>
|
<WalletBox>
|
||||||
{globalNotification && (
|
{globalNotification && (
|
||||||
|
@ -396,10 +396,10 @@ function headerListener(
|
|||||||
}
|
}
|
||||||
|
|
||||||
function setupHeaderListener(): void {
|
function setupHeaderListener(): void {
|
||||||
if (chrome.runtime.getManifest().manifest_version === 3) {
|
// if (chrome.runtime.getManifest().manifest_version === 3) {
|
||||||
console.error("cannot block request on manfest v3")
|
// console.error("cannot block request on manfest v3")
|
||||||
return
|
// return
|
||||||
}
|
// }
|
||||||
console.log("setting up header listener");
|
console.log("setting up header listener");
|
||||||
// Handlers for catching HTTP requests
|
// Handlers for catching HTTP requests
|
||||||
getPermissionsApi().contains(getReadRequestPermissions(), (result: boolean) => {
|
getPermissionsApi().contains(getReadRequestPermissions(), (result: boolean) => {
|
||||||
@ -415,7 +415,7 @@ function setupHeaderListener(): void {
|
|||||||
chrome.webRequest.onHeadersReceived.addListener(
|
chrome.webRequest.onHeadersReceived.addListener(
|
||||||
headerListener,
|
headerListener,
|
||||||
{ urls: ["<all_urls>"] },
|
{ urls: ["<all_urls>"] },
|
||||||
["responseHeaders", "blocking"],
|
["responseHeaders"]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if ("webRequest" in chrome) {
|
if ("webRequest" in chrome) {
|
||||||
|
Loading…
Reference in New Issue
Block a user