From 2a5b378bac2ae8c2ea86de46d8df0e2aa5bf533b Mon Sep 17 00:00:00 2001 From: adalseno Date: Fri, 23 Jan 2026 15:12:44 +0100 Subject: [PATCH 1/2] Fix omnibox search navigation When entering a search term in the omnibox (lk shortcut), the extension was navigating to the literal string 'lk' instead of constructing a proper search URL to the Linkwarden instance. Changes: - Fix omnibox to navigate to /search?q= instead of 'lk' - Fix manifest.json: remove 'scripts' field invalid in Manifest V3 - Use config.baseUrl consistently in context menu handler - Use config.defaultCollection instead of hardcoded 'Unorganized' Fixes linkwarden/linkwarden#978 Co-Authored-By: Claude Opus 4.5 --- manifest.json | 1 - src/pages/Background/index.ts | 11 +++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/manifest.json b/manifest.json index 985f600..1442e09 100644 --- a/manifest.json +++ b/manifest.json @@ -31,7 +31,6 @@ "host_permissions": [""], "background": { "service_worker": "background.js", - "scripts": ["background.js"], "type": "module" }, "omnibox": { "keyword": "lk" }, diff --git a/src/pages/Background/index.ts b/src/pages/Background/index.ts index 387ff42..6df5689 100644 --- a/src/pages/Background/index.ts +++ b/src/pages/Background/index.ts @@ -200,7 +200,7 @@ async function genericOnClick( info: OnClickData, tab: chrome.tabs.Tab | undefined ) { - const { syncBookmarks, baseUrl } = await getConfig(); + const { syncBookmarks } = await getConfig(); const configured = await isConfigured(); if (!tab?.url || !tab?.title || !configured) { return; @@ -251,11 +251,11 @@ async function genericOnClick( try { const newLink = await postLinkFetch( - baseUrl, + config.baseUrl, { url: tab.url, collection: { - name: 'Unorganized', + name: config.defaultCollection, }, tags: [], name: tab.title, @@ -395,7 +395,10 @@ browser.omnibox.onInputEntered.addListener( } const isUrl = /^http(s)?:\/\//.test(content); - const url = isUrl ? content : `lk`; + const config = await getConfig(); + const url = isUrl + ? content + : `${config.baseUrl}/search?q=${encodeURIComponent(content)}`; // Edge doesn't allow updating the New Tab Page (tested with version 117). // Trying to do so will throw: "Error: Cannot update NTP tab." From 9f0a7399bc6da62e305ea58b18626c5bd7d04dd8 Mon Sep 17 00:00:00 2001 From: adalseno Date: Fri, 23 Jan 2026 15:36:54 +0100 Subject: [PATCH 2/2] Restore background.scripts for Firefox compatibility Chrome MV3 shows a warning but works with both fields. Firefox MV3 requires scripts as service_worker is not yet supported. Co-Authored-By: Claude Opus 4.5 --- manifest.json | 1 + 1 file changed, 1 insertion(+) diff --git a/manifest.json b/manifest.json index 1442e09..985f600 100644 --- a/manifest.json +++ b/manifest.json @@ -31,6 +31,7 @@ "host_permissions": [""], "background": { "service_worker": "background.js", + "scripts": ["background.js"], "type": "module" }, "omnibox": { "keyword": "lk" },