Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upImport favicons from Brave #440
Closed
Labels
Comments
|
Closing as this is no longer valid; we removed the Muon import code |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Follow-up for brave/brave-core#185.
The standard behavior for browser importers in Chromium/Brave is to import favicons automatically when the user imports bookmarks. This allows the bookmarks in the bookmarks bar, menu, and manager to be immediately accompanied by their familiar favicons, which is a useful visual aid for users.
Importing favicons from Chrome was implemented as part of brave/brave-core#49. It was straightforward thanks to Chrome's implementation, which stores the metadata and bitmaps of favicons in a dedicated
Faviconssqlite db.Brave browser-laptop's situation is more complicated. The entries in
session-store-1's"bookmarks"dict have afaviconkey, but this is the URL of the favicon rather than the bitmap data, which is what we are looking to import. In some cases, the favicon URL is adata:URL, in which case the bitmap data is encoded in the URL, but this is uncommon and depends on the corresponding website's implementation.After asking on Slack, I learned that since browser-laptop uses webContents to render the UI, including favicons, they are probably available in the cache. There are some further questions that I have not yet had time to investigate:
~/Library/Application\ Support/brave/Cache/shows it's not a simple sqlite database (from a glance, it looks like a Merkle tree). We'll probably have to use Chromium's cache API's.Steps to Reproduce
Actual result:
The bookmark entries in the Bookmarks Manager (or anywhere else in the UI) do not have favicons associated with them; instead, there is an empty square.
If you visit a bookmark (more specifically, any page that shares the bookmark's origin) and then refresh the Bookmarks Manager, the favicon should become visible because it was loaded anew from the network.
Expected result:
Imported bookmarks should immediately have the correct favicons associated with them in the UI, to make the transition experience as seamless as possible.