aboutsummaryrefslogtreecommitdiffstats
path: root/apps/browser-extension/src/background/background.ts
diff options
context:
space:
mode:
authorMohamed Bassem <me@mbassem.com>2026-02-08 03:05:34 +0000
committerMohamed Bassem <me@mbassem.com>2026-02-08 03:05:34 +0000
commit1a01f75d35abb4aa02edee22e1e5640d3f0aa27c (patch)
tree7051fa5c649e2820cf8e3d108e5730f4cf316b4c /apps/browser-extension/src/background/background.ts
parentbbd65fd6123f7d1a93d1f6a68f2b933d53ec3c23 (diff)
downloadkarakeep-1a01f75d35abb4aa02edee22e1e5640d3f0aa27c.tar.zst
fix(extension): dont store tab title when saving links or images. fixes #2462
Diffstat (limited to '')
-rw-r--r--apps/browser-extension/src/background/background.ts6
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/browser-extension/src/background/background.ts b/apps/browser-extension/src/background/background.ts
index 04089cc8..0acaa919 100644
--- a/apps/browser-extension/src/background/background.ts
+++ b/apps/browser-extension/src/background/background.ts
@@ -115,12 +115,16 @@ async function handleContextMenuClick(
} else if (menuItemId === CLEAR_ALL_CACHE_ID) {
await clearAllCache();
} else if (menuItemId === ADD_LINK_TO_KARAKEEP_ID) {
+ // Only pass the current page title when the URL being saved is the
+ // page itself. When saving a link or image, the title would
+ // incorrectly be the current page's title instead of the target's.
+ const isCurrentPage = !srcUrl && !linkUrl;
addLinkToKarakeep({
selectionText,
srcUrl,
linkUrl,
pageUrl,
- title: tab?.title,
+ title: isCurrentPage ? tab?.title : undefined,
});
// NOTE: Firefox only allows opening context menus if it's triggered by a user action.