Request for bookmarks.onClicked event that returns a BookmarkTreeNode object
Categories
(WebExtensions :: General, enhancement, P3)
Tracking
(Not tracked)
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:
- 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.
- 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.
Comment 1•2 years ago
|
||
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.
Comment 2•2 years ago
|
||
I believe this needs to at least start as a WebExtension request
Updated•2 years ago
|
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?
Updated•2 years ago
|
Comment 4•2 years ago
|
||
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.
Updated•2 years ago
|
Description
•