gnunet-svn
[Top][All Lists]
Advanced

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

[taler-wallet-core] branch master updated: fix #8371


From: gnunet
Subject: [taler-wallet-core] branch master updated: fix #8371
Date: Mon, 04 Mar 2024 16:07:40 +0100

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

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

The following commit(s) were added to refs/heads/master by this push:
     new 6c124075b fix #8371
6c124075b is described below

commit 6c124075b9a8540d848cd02cc3ba170eae052915
Author: Sebastian <sebasjm@gmail.com>
AuthorDate: Mon Mar 4 12:07:35 2024 -0300

    fix #8371
---
 packages/taler-wallet-webextension/src/context/alert.ts   |  2 +-
 packages/taler-wallet-webextension/src/platform/api.ts    |  5 +++++
 packages/taler-wallet-webextension/src/platform/chrome.ts | 14 ++++++++------
 packages/taler-wallet-webextension/src/platform/dev.ts    |  1 +
 4 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/packages/taler-wallet-webextension/src/context/alert.ts 
b/packages/taler-wallet-webextension/src/context/alert.ts
index 45fc9d9d9..36de7c7e4 100644
--- a/packages/taler-wallet-webextension/src/context/alert.ts
+++ b/packages/taler-wallet-webextension/src/context/alert.ts
@@ -222,7 +222,7 @@ function isWalletNotAvailable(i18n: 
InternationalizationAPI, detail: TalerErrorD
     && detail.lastError) {
     const le = detail.lastError as TalerErrorDetail
     if (le.code === TalerErrorCode.WALLET_DB_UNAVAILABLE) {
-      if (platform.isFirefox()) {
+      if (platform.isFirefox() && platform.runningOnPrivateMode()) {
         return i18n.str`Could not open the wallet database. Firefox is known 
to run into this problem under "permanent private mode".`
       } else {
         return i18n.str`Could not open the wallet database.`
diff --git a/packages/taler-wallet-webextension/src/platform/api.ts 
b/packages/taler-wallet-webextension/src/platform/api.ts
index 57e7c51f4..4ae629dc3 100644
--- a/packages/taler-wallet-webextension/src/platform/api.ts
+++ b/packages/taler-wallet-webextension/src/platform/api.ts
@@ -233,6 +233,11 @@ export interface BackgroundPlatformAPI {
 
 }
 export interface ForegroundPlatformAPI {
+  /**
+   * Check if the extension is running under
+   * chrome incognito or firefox private mode.
+   */
+  runningOnPrivateMode(): boolean;
   /**
    * FIXME: should not be needed
    *
diff --git a/packages/taler-wallet-webextension/src/platform/chrome.ts 
b/packages/taler-wallet-webextension/src/platform/chrome.ts
index 68b065853..2cdc4d8b6 100644
--- a/packages/taler-wallet-webextension/src/platform/chrome.ts
+++ b/packages/taler-wallet-webextension/src/platform/chrome.ts
@@ -16,12 +16,11 @@
 
 import {
   Logger,
-  TalerErrorCode,
-  TalerUriAction,
   TalerError,
-  parseTalerUri,
+  TalerErrorCode,
   TalerUri,
-  stringifyTalerUri,
+  TalerUriAction,
+  stringifyTalerUri
 } from "@gnu-taler/taler-util";
 import { WalletOperations } from "@gnu-taler/taler-wallet-core";
 import { BackgroundOperations } from "../wxApi.js";
@@ -33,9 +32,8 @@ import {
   MessageFromBackend,
   MessageFromFrontend,
   MessageResponse,
-  Permissions,
   Settings,
-  defaultSettings,
+  defaultSettings
 } from "./api.js";
 
 const api: BackgroundPlatformAPI & ForegroundPlatformAPI = {
@@ -44,6 +42,7 @@ const api: BackgroundPlatformAPI & ForegroundPlatformAPI = {
   findTalerUriInActiveTab,
   findTalerUriInClipboard,
   getPermissionsApi,
+  runningOnPrivateMode,
   getWalletWebExVersion,
   triggerWalletEvent,
   listenToWalletBackground,
@@ -739,3 +738,6 @@ function listenNetworkConnectionState(
   };
 }
 
+function runningOnPrivateMode(): boolean {
+  return chrome.extension.inIncognitoContext
+}
\ No newline at end of file
diff --git a/packages/taler-wallet-webextension/src/platform/dev.ts 
b/packages/taler-wallet-webextension/src/platform/dev.ts
index 7cbbe5b25..1e43476ea 100644
--- a/packages/taler-wallet-webextension/src/platform/dev.ts
+++ b/packages/taler-wallet-webextension/src/platform/dev.ts
@@ -29,6 +29,7 @@ import {
 const logger = new Logger("dev.ts");
 
 const api: BackgroundPlatformAPI & ForegroundPlatformAPI = {
+  runningOnPrivateMode: () => false,
   isFirefox: () => false,
   getSettingsFromStorage: () => Promise.resolve(defaultSettings),
   keepAlive: (cb: VoidFunction) => cb(),

-- 
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]