Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import favicons from Brave #440

Closed
garrettr opened this issue Jun 27, 2018 · 1 comment
Closed

Import favicons from Brave #440

garrettr opened this issue Jun 27, 2018 · 1 comment

Comments

@garrettr
Copy link
Contributor

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 Favicons sqlite db.

Brave browser-laptop's situation is more complicated. The entries in session-store-1's "bookmarks" dict have a favicon key, 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 a data: 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:

  1. Does the cache contain all favicons, or only a subset (due to eviction)?
  2. How do we query and retrieve data from the cache? A quick look at ~/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

  1. Start brave-browser with a clean profile.
  2. Import bookmarks from a Brave browser-laptop profile.
  3. Open the Bookmarks Manager

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.

@garrettr garrettr added this to the Backlog milestone Jun 27, 2018
@garrettr garrettr self-assigned this Jun 27, 2018
@rebron rebron modified the milestone: 1.x Backlog Feb 7, 2019
@bsclifton
Copy link
Member

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
Projects
None yet
Development

No branches or pull requests

4 participants