fix: URL redirection issue (#280)

This commit is contained in:
Amado Tejada 2024-08-22 21:08:07 -04:00 committed by GitHub
parent 3c0b3369b8
commit f89100d721
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -13,7 +13,8 @@ chrome.webRequest.onBeforeRequest.addListener(
const shortcutName = getShortcutNameFromUrl(param.url); const shortcutName = getShortcutNameFromUrl(param.url);
if (shortcutName) { if (shortcutName) {
const instanceUrl = (await storage.getItem<string>("instance_url")) || ""; const instanceUrl = (await storage.getItem<string>("instance_url")) || "";
return chrome.tabs.update({ url: `${instanceUrl}/s/${shortcutName}` }); const url = new URL(`/s/${shortcutName}`, instanceUrl);
return chrome.tabs.update({ url: url.toString() });
} }
})(); })();
}, },