mirror of
https://github.com/aykhans/slash-e.git
synced 2025-04-16 04:13:12 +00:00
fix: URL redirection issue (#280)
This commit is contained in:
parent
3c0b3369b8
commit
f89100d721
@ -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() });
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user