mirror of
https://github.com/aykhans/slash-e.git
synced 2025-07-23 05:14:26 +00:00
chore: rename to slash
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { getShortifyData } from "./common.js";
|
||||
import { getSlashData } from "./common.js";
|
||||
|
||||
const urlRegex = /https?:\/\/s\/(.+)/;
|
||||
|
||||
@@ -6,16 +6,16 @@ chrome.tabs.onUpdated.addListener(async (tabId, changeInfo, tab) => {
|
||||
if (typeof tab.url === "string") {
|
||||
const matchResult = urlRegex.exec(tab.url);
|
||||
if (matchResult) {
|
||||
const shortifyData = await getShortifyData();
|
||||
const slashData = await getSlashData();
|
||||
const name = matchResult[1];
|
||||
const url = `${shortifyData.domain}/s/${name}`;
|
||||
return chrome.tabs.update({ url });
|
||||
const url = `${slashData.domain}/s/${name}`;
|
||||
return chrome.tabs.update(tab.id, { url });
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
chrome.omnibox.onInputEntered.addListener(async (text) => {
|
||||
const shortifyData = await getShortifyData();
|
||||
const url = `${shortifyData.domain}/s/${text}`;
|
||||
const slashData = await getSlashData();
|
||||
const url = `${slashData.domain}/s/${text}`;
|
||||
return chrome.tabs.update({ url });
|
||||
});
|
||||
|
Reference in New Issue
Block a user