mozilla / policy-templates

Policy Templates for Firefox
Mozilla Public License 2.0
1.15k stars 408 forks source link

ManagedBookmarks don't use favicons #816

Closed spacevoyager78 closed 2 years ago

spacevoyager78 commented 2 years ago

Hi! If I use ManagedBookmarks policy and click on the links, the bookmarks' icons don't get updated with the favicons of the web pages, contrary to normal bookmarks. Is this by design or a bug?

mkaply commented 2 years ago

They should get the correct icon on restart, but as designed, they don't update their icons. Probably worth opening a bug to see how easy it would be to do.

spacevoyager78 commented 2 years ago

I am not getting any favicon at all, just the default bookmark icon.

mkaply commented 2 years ago

So it kind of depends on the URL and how we store it in history.

So if the URL in the ManagedBookmarks matches the URL exactly, it will get the icon.

For instance, If I visit:

https://www.divoom.com/product/Pixoo-Max.html

and then add a managed bookmark for that same URL, I will get the correct icon.

Would it help if I just added support for icons?

spacevoyager78 commented 2 years ago

Ah, I see. I have chosen to delete visited pages history each time I close the browser, so that's why I didn't get any favicon. However, the icons of normal bookmarks don't get lost with my settings, so I think it would be better if there was explicit support of favicon as you suggested in the form of Favicon property, just like in the original Bookmarks policy.

mkaply commented 2 years ago

That's really odd because bookmarks work the same way as the icon in ManagedBookmarks. They use an internal URL that looks like this:

page-icon:https://example.com

I'll check with the team to find out how they are sticking around.

spacevoyager78 commented 2 years ago

Correction: deleting visited pages history doesn't affect the icons. However, I can only get icons in ManagedBookmarks if I also make the same url a normal bookmark. If I later delete the normal bookmark, the icon of the ManagedBookmarks is gone,

spacevoyager78 commented 2 years ago

@mkaply I will try to be more precise to help. I use

"SanitizeOnShutdown": {
  "FormData": true,
  "History": true,
  "Sessions": true,
  "Locked": true
}

When I have the above policy, the ManagedBookmarks icons are always the default ones, they don't get the webpage favicon if I visit the url and restart Firefox. But, if I make a normal bookmark with the same url, the ManagedBookmarks icons do get the favicons after I restart Firefox. If I delete the normal bookmark and restart Firefox, the ManagedBookmarks icons revert to the default ones. If I remove the SanitizeOnShutdown policy, everything works normally (I don't have to make normal bookmarks for the favicons to appear in ManagedBookmarks), but if I add again the SanitizeOnShutdown policy, the ManagedBookmarks icons revert again to the default ones. I hope I explained it better :-)

spacevoyager78 commented 2 years ago

@mkaply should I file a bug in bugzilla about this? A sample file is this (BE CAREFUL, you will lose browsing history):

{
  "policies": {
    "ManagedBookmarks": [
      {
        "url": "https://github.com/",
        "name": "GitHub"
      }
    ],
    "SanitizeOnShutdown": {
      "History": true
    }
  }
}

With this file, no favicon will be used for GitHub website. I am reverting to Bookmarks policy because of this.

spacevoyager78 commented 2 years ago

@mkaply The relevant bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1741221

mkaply commented 2 years ago

Thanks. My process is to close this in github since we have bug for it