chrome.tabs.update does not work on async request interception, so using a delay
This commit is contained in:
parent
c0be242292
commit
e84cb95887
@ -226,20 +226,18 @@ function makeSyncWalletRedirect(
|
|||||||
.join("&");
|
.join("&");
|
||||||
innerUrl.hash = innerUrl.hash + "?" + hParams;
|
innerUrl.hash = innerUrl.hash + "?" + hParams;
|
||||||
}
|
}
|
||||||
// if (isFirefox()) {
|
// Some platforms don't support the sync redirect (yet), so fall back to
|
||||||
// // Some platforms don't support the sync redirect (yet), so fall back to
|
// async redirect after a timeout.
|
||||||
// // async redirect after a timeout.
|
const doit = async (): Promise<void> => {
|
||||||
// const doit = async (): Promise<void> => {
|
await waitMs(150);
|
||||||
// await waitMs(150);
|
const tab = await getTab(tabId);
|
||||||
// const tab = await getTab(tabId);
|
if (tab.url === oldUrl) {
|
||||||
// if (tab.url === oldUrl) {
|
console.log("redirecting to", innerUrl.href);
|
||||||
// chrome.tabs.update(tabId, { url: innerUrl.href });
|
chrome.tabs.update(tabId, { url: innerUrl.href });
|
||||||
// }
|
}
|
||||||
// };
|
};
|
||||||
// doit();
|
doit();
|
||||||
// }
|
|
||||||
console.log("redirecting to", innerUrl.href);
|
|
||||||
chrome.tabs.update(tabId, { url: innerUrl.href });
|
|
||||||
return { redirectUrl: innerUrl.href };
|
return { redirectUrl: innerUrl.href };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user