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

Caching favicon #31

Open
PhilJbt opened this issue Nov 1, 2024 · 4 comments
Open

Caching favicon #31

PhilJbt opened this issue Nov 1, 2024 · 4 comments

Comments

@PhilJbt
Copy link

PhilJbt commented Nov 1, 2024

Caching the favicon when adding a new "Open URL" to the menu could reduce initial loading time each time the menu opens on a page. Or maybe cache, at the menu opening, it if it's not referenced in the extension storage.

I would like to take this opportunity to thank you for this extension, which is both useful and well-made!

@emvaized
Copy link
Owner

emvaized commented Nov 2, 2024

Thanks for your kind words! 🙏
I don't think it will be possible to do with current implementation of favicons, because each time they are being fetched from Google automatically.

But it probably makes sense to add separate "custom favicon url" settings field, and therefore you would be able to cache it by manually downloading the needed image and converting it to Base64 format

@emvaized
Copy link
Owner

emvaized commented Nov 3, 2024

The new version 1.5.1 will introduce a new option for custom icon for each "openUrl" action. You can use it to cache icons by passing a base64 converted image. Keep in mind you might need to reload the "Settings" page in order to see updated preview with custom icons.

For example, here's base64 version of the default Google favicon, which can be used in that field:

data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAkFBMVEVHcEzg4eL////6+/v////////4+fn9/v7x8vL9/f38/Pz+/v7///////////8dpUb+/PzqOy0xfvPR3/2938T8vQWEq/f79PAvqE7wfHXpMx/l7P08g/WRs/ntYVcjfep1v43ykYv51tR0ofa4zfrv+fdPqUf629fh8OXs04ONyJqNyZpjuHj5zK34qAD8yjs3yEdfAAAADnRSTlMADRWS0qBtLAR85TtHou17CO8AAAChSURBVBiVbY/HAoMgEESxizEjEHvX9P7/f5cF9ZZ32WW2DYxpAu55PGAbtguDay/vgHIxz4KCaQopmWop64mkkIQ90EtZVXVFFY8E4C37AijMHrPh+7kCB6LRW2Igy6g0KKWOQMx2WqD2vMvbHNjpI/fLqMc7dTJnXJyT8pWm49CSt8XXrUyIslmdcWpPH8+UAl+8+1jxt99ZTiRE5FjsHz8fNQziOWMtZgAAAABJRU5ErkJggg==

I believe that such icons should be loaded without any noticable delay. But for future versions I will consider adding a more advanced caching mechanism for network icons as well.

@PhilJbt
Copy link
Author

PhilJbt commented Nov 3, 2024

Actually, I really wonder if your idea of ​​allowing people to define their own custom favicon is not the best one. In particular, it allows users to distinguish between two buttons with the same domain, which is my case (I have two URLs going to YouTube). This seems way better in my eye!

@emvaized
Copy link
Owner

emvaized commented Nov 3, 2024

I'm glad you liked it! Version 1.5.1 is under review, and should become available on Chrome within a few days. On Firefox it's already published.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants