How to get Favicon from bookmarks?

Hi, I am developing an add-on which retrieves all the bookmarks of the user and displaying the title of the bookmark on a pop-up toolbar. I want to show the favicon of the site beside the title, just like how it shows on the Bookmarks Toolbar. How do i do this?

Hi, I am developing also an add-on which retrieves user bookmarks, and the only solution I’ve found to get bookmark favicons is :

  1. Get tab info when user navigates with browser.tabs.onUpdated
  2. Search tab.url in bookmarks
  3. If bookmark is found, then add tab.favIconUrl to bookmark
  4. Save bookmark to browser.storage.local

Then you load bookmarks from browser.storage.local on addon start and you have favicons. The only drawback is that you don’t have favicons at first start, until user goes to these urls.
Waiting for the support of bookmarks.BookmarkTreeNode.favIconUrl property (maybe), I hope it will help :roll_eyes:

1 Like