Closed Bug 1808148 Opened 2 years ago Closed 2 years ago

Request for bookmarks.onClicked event that returns a BookmarkTreeNode object

Categories

(WebExtensions :: General, enhancement, P3)

Firefox 108
enhancement

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: billy78, Unassigned)

References

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0

Steps to reproduce:

I propose a bookmarks.onClicked event that would return a BookmarkTreeNode object.

I am writing an add-on with the following features:

  1. When a bookmark is created, it checks if the tab has a Multi-Account Container and stores the bookmark ID with the container ID using storage.local.
  2. When a bookmark is clicked, it reads its ID and checks in storage.local if it has a matching container ID, then it loads the url in the container. If it doesn't have a matching container ID, it checks if the folder name of the bookmark matches any container name, so it loads the url in this container.

Actual results:

However, I can't implement (2) because there is no bookmarks.onClicked event that would return a BookmarkTreeNode object.

Expected results:

So, I propose a bookmarks.onClicked event that would return a BookmarkTreeNode object.

Summary: Request for bookmarks.onClicked event → Request for bookmarks.onClicked event that returns a BookmarkTreeNode object

The Bugbug bot thinks this bug should belong to the 'Firefox::Bookmarks & History' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Bookmarks & History
Product: WebExtensions → Firefox

I believe this needs to at least start as a WebExtension request

Component: Bookmarks & History → General
Product: Firefox → WebExtensions
Whiteboard: [design-decision-needed]

I would like to add that if I am not able to stop the loading of the url of the bookmark with the information from bookmarks.onClicked event, so as to handle the loading myself, than I'm not sure that the event I propose will be any useful to me. So, should I forget it or is there something that I'm not thinking?

Severity: -- → N/A
Priority: -- → P3

This bug is basically about taking over the default behavior when a bookmark is clicked. But it wouldn't cover navigation to URLs from the location bar, other menu items, etc.

This would fit better as a browser feature, bug 1502167. MAC has a feature request at https://github.com/mozilla/multi-account-containers/issues/323

Extensions can already mimic this behavior by modifying the bookmark to include the desired container in the URL, and then using the webRequest API to detect navigations to it and then doing something with it.

Status: UNCONFIRMED → RESOLVED
Closed: 2 years ago
Resolution: --- → WONTFIX
See Also: → 1502167
Whiteboard: [design-decision-needed]
See Also: → 1448518
You need to log in before you can comment on or make changes to this bug.