[PR #866] Fix context menu handling to prioritize link URLs and include anchor text as bookmark titles #1710

Open
opened 2026-03-02 11:58:49 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/karakeep-app/karakeep/pull/866
Author: @dakshpareek
Created: 1/12/2025
Status: 🔄 Open

Base: mainHead: feature/extension-link-saving


📝 Commits (1)

  • 1045de0 fix: context menu handling to prioritize link URLs over selected text

📊 Changes

1 file changed (+7 additions, -1 deletions)

View changed files

📝 apps/browser-extension/src/background/background.ts (+7 -1)

📄 Description

Problem: When users select anchor text and click "Add to Hoarder," the extension was capturing the selected text instead of the link URL. As a result, only the selected text was saved in Hoarder.

issue

Solution: Modified handleContextMenuClick in background.ts:

  • Prioritized info.linkUrl over info.selectionText when determining what to hoard.
  • Captured the selected anchor text as the title when saving a link bookmark.

solution


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/karakeep-app/karakeep/pull/866 **Author:** [@dakshpareek](https://github.com/dakshpareek) **Created:** 1/12/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feature/extension-link-saving` --- ### 📝 Commits (1) - [`1045de0`](https://github.com/karakeep-app/karakeep/commit/1045de05bc46c2aadf00ab74df42e731a89d4136) fix: context menu handling to prioritize link URLs over selected text ### 📊 Changes **1 file changed** (+7 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `apps/browser-extension/src/background/background.ts` (+7 -1) </details> ### 📄 Description **Problem:** When users select anchor text and click "Add to Hoarder," the extension was capturing the selected text instead of the link URL. As a result, only the selected text was saved in Hoarder. ![issue](https://github.com/user-attachments/assets/17314a5c-f174-49fe-93f8-02bf2979e9d1) **Solution:** **Modified `handleContextMenuClick` in `background.ts`:** - Prioritized `info.linkUrl` over `info.selectionText` when determining what to hoard. - Captured the selected anchor text as the `title` when saving a link bookmark. ![solution](https://github.com/user-attachments/assets/ca5dd51a-9b94-4195-bb96-2bef888d824a) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/karakeep#1710
No description provided.