gnunet-svn
[Top][All Lists]
Advanced

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

[taler-wallet-core] branch master updated: chrome.tabs.update does not w


From: gnunet
Subject: [taler-wallet-core] branch master updated: chrome.tabs.update does not work on async request interception, so using a delay
Date: Tue, 15 Mar 2022 21:46:56 +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 e84cb958 chrome.tabs.update does not work on async request 
interception, so using a delay
e84cb958 is described below

commit e84cb958878582638681897ccb5745508e825005
Author: Sebastian <sebasjm@gmail.com>
AuthorDate: Tue Mar 15 17:46:09 2022 -0300

    chrome.tabs.update does not work on async request interception, so using a 
delay
---
 .../taler-wallet-webextension/src/wxBackend.ts     | 26 ++++++++++------------
 1 file changed, 12 insertions(+), 14 deletions(-)

diff --git a/packages/taler-wallet-webextension/src/wxBackend.ts 
b/packages/taler-wallet-webextension/src/wxBackend.ts
index 66debf26..64373514 100644
--- a/packages/taler-wallet-webextension/src/wxBackend.ts
+++ b/packages/taler-wallet-webextension/src/wxBackend.ts
@@ -226,20 +226,18 @@ function makeSyncWalletRedirect(
       .join("&");
     innerUrl.hash = innerUrl.hash + "?" + hParams;
   }
-  // if (isFirefox()) {
-  //   // Some platforms don't support the sync redirect (yet), so fall back to
-  //   // async redirect after a timeout.
-  //   const doit = async (): Promise<void> => {
-  //     await waitMs(150);
-  //     const tab = await getTab(tabId);
-  //     if (tab.url === oldUrl) {
-  //       chrome.tabs.update(tabId, { url: innerUrl.href });
-  //     }
-  //   };
-  //   doit();
-  // }
-  console.log("redirecting to", innerUrl.href);
-  chrome.tabs.update(tabId, { url: innerUrl.href });
+  // Some platforms don't support the sync redirect (yet), so fall back to
+  // async redirect after a timeout.
+  const doit = async (): Promise<void> => {
+    await waitMs(150);
+    const tab = await getTab(tabId);
+    if (tab.url === oldUrl) {
+      console.log("redirecting to", innerUrl.href);
+      chrome.tabs.update(tabId, { url: innerUrl.href });
+    }
+  };
+  doit();
+
   return { redirectUrl: innerUrl.href };
 }
 

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