mirror of
https://github.com/aykhans/slash-e.git
synced 2025-04-28 00:53:07 +00:00
chore: update extension pnpm lock file
This commit is contained in:
parent
2264b64007
commit
07365fda73
@ -47,10 +47,12 @@
|
|||||||
},
|
},
|
||||||
"manifest": {
|
"manifest": {
|
||||||
"host_permissions": [
|
"host_permissions": [
|
||||||
|
"http://*/*",
|
||||||
"https://*/*"
|
"https://*/*"
|
||||||
],
|
],
|
||||||
"permissions": [
|
"permissions": [
|
||||||
"tabs",
|
"tabs",
|
||||||
|
"activeTab",
|
||||||
"scripting",
|
"scripting",
|
||||||
"storage"
|
"storage"
|
||||||
]
|
]
|
||||||
|
561
extension/pnpm-lock.yaml
generated
561
extension/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -5,16 +5,18 @@ const storage = new Storage();
|
|||||||
const urlRegex = /https?:\/\/s\/(.+)/;
|
const urlRegex = /https?:\/\/s\/(.+)/;
|
||||||
|
|
||||||
chrome.tabs.onUpdated.addListener(async (tabId, _, tab) => {
|
chrome.tabs.onUpdated.addListener(async (tabId, _, tab) => {
|
||||||
if (typeof tab.url === "string") {
|
if (!tab.url) {
|
||||||
const shortcutName = getShortcutNameFromUrl(tab.url);
|
return;
|
||||||
if (shortcutName) {
|
}
|
||||||
const shortcuts = (await storage.getItem<Shortcut[]>("shortcuts")) || [];
|
|
||||||
const shortcut = shortcuts.find((shortcut) => shortcut.name === shortcutName);
|
const shortcutName = getShortcutNameFromUrl(tab.url);
|
||||||
if (!shortcut) {
|
if (shortcutName) {
|
||||||
return;
|
const shortcuts = (await storage.getItem<Shortcut[]>("shortcuts")) || [];
|
||||||
}
|
const shortcut = shortcuts.find((shortcut) => shortcut.name === shortcutName);
|
||||||
return chrome.tabs.update(tabId, { url: shortcut.link });
|
if (!shortcut) {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
return chrome.tabs.update(tabId, { url: shortcut.link });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user