Initial release

This commit is contained in:
aculix committed 2026-09-28 18:28:32 +05:30
commit 4b67728cce
108 files changed
+13310

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
// Chrome gives the Services menu a link's text, never its address, hence this extension.
chrome.runtime.onInstalled.addListener(() => {
chrome.contextMenus.create({ id: "open-in-knotchy", title: "Open in Knotchy", contexts: ["link"] });
});
chrome.contextMenus.onClicked.addListener((info, tab) => {
if (info.menuItemId !== "open-in-knotchy" || !info.linkUrl || !tab || tab.id === undefined) return;
if (!/^https?:\/\//i.test(info.linkUrl)) return;
const target = "knotchy://open?url=" + encodeURIComponent(info.linkUrl);
// Hands the URL to the app without leaving the page.
chrome.tabs.update(tab.id, { url: target });
});