Jelmerro / Vieb

Vim Inspired Electron Browser - Vim bindings for the web by design
https://vieb.dev
GNU General Public License v3.0
1.32k stars 65 forks source link

Some favorites doesn't have icons nor names #144

Closed ByJumperX4 closed 3 years ago

ByJumperX4 commented 3 years ago

Checklist

Describe the bug Some websites won't have icons nor names when added to favorites

image

To Reproduce Add some favorites, and find some websites that won't work

Expected behavior Every favorite should have an icon and a name

Specs

Jelmerro commented 3 years ago

This is likely because you haven't visited these pages yet. Fetching the correct favicon and title require a connection to the page to be made, which Vieb will NOT do when you add favoritepages. One of Vieb's core aspects is privacy, which also comes with a handful of drawbacks. The favicons are cached, so you only need to visit them once, but it won't automatically connect to sites just because you updated some local setting. The same is true for other settings and most other features. The only notable exception is when you ask Vieb to automatically update the adblocker lists, that can only be done by making a request, for which Vieb will always show a notification when this happens.

Let me know if I was correct to assume you haven't visited these pages or if you think there is a different problem happening.

ByJumperX4 commented 3 years ago

I did visited those pages, I visit them all very often. For example, mastodon.online does have an Icon in the tabs list when I open it, but it will never have one in my favourites list

Jelmerro commented 3 years ago

Can you check if the url matches with the one recorded in your history?

ByJumperX4 commented 3 years ago

I think it's that, it redirects to something else, like git.gnous.eu that goes to git.gnous.eu/explore/repos

Jelmerro commented 3 years ago

Right, currently there isn't any logic to keep these redirects linked to a favicon, as that url doesn't actually have one. Same for the title. I see two options to handle these type of redirects:

If you have any other suggestions, let me know, but these seem to me like the only two options.

ByJumperX4 commented 3 years ago

Maybe adding an option like :set favoritepagesreditects true ?

Jelmerro commented 3 years ago

This is not only for favoritepages though, but also for topsites and other places. Besides, a setting like that would only take effect the next time you would visit that page, because it would require storing this as the redirect happens. Speaking of which, I'm not sure how redirects are actually communicated with Electron and if we would need to check only same domain redirects or allow any redirect to have this behavior.

Jelmerro commented 3 years ago

Turns out that there are APIs in electron to catch redirects, I'll update the favicon and page title mappings with them shortly. That should resolve most of this issue, but you'll always need to visit the page at least once to get the favicon as Vieb won't request it in the background.

Jelmerro commented 3 years ago

Let me know if my latest commit fixes this issue for you as well.

Jelmerro commented 3 years ago

Implemented in the latest release 5.1.0 release.