CefNavigationEntry::GetFaviconURLs()

Think CEF could benefit from a new feature or capability? Discuss CEF feature requests here.

CefNavigationEntry::GetFaviconURLs()

Postby cretz » Wed Jul 12, 2017 1:32 pm

Both FF and Chrome show the favicons of the navigation state in their back and forward dropdowns. Is there any way to include this in the navigation entry? Otherwise, what is the recommended approach and how do browsers like Chrome solve this?

Options as I see them:

1. Ask for domain.com/favicon.ico - Con: doesn't include the PNG they may have set in the meta tag...important for per-page favicon differences
2. Store favicon URL change and maintain my own forward/back - Con: At this point I should just have my own history stack then
3. Cache favicons per browser by URL - Con: A bit of memory leak problem (cache invalidation is tough here, though I guess I could invalidate entries that aren't in the nav list), Con: Two identical URLs w/ different favicons might have issues
4. CefNavigationEntry::GetFaviconURLs()

Is #4 a reasonable request to open an issue for? If not, what's the best workaround? #3?
cretz
Techie
 
Posts: 34
Joined: Mon Jun 26, 2017 11:41 am

Re: CefNavigationEntry::GetFaviconURLs()

Postby magreenblatt » Wed Jul 12, 2017 2:36 pm

There's already a CefDisplayHandler::OnFaviconURLChange callback. Is there some reason that doesn't work for you?
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: CefNavigationEntry::GetFaviconURLs()

Postby fddima » Wed Jul 12, 2017 3:14 pm

magreenblatt wrote:There's already a CefDisplayHandler::OnFaviconURLChange callback. Is there some reason that doesn't work for you?


I think it is listed in option #2 . But somewhy own history stack used, while store/matching favicons by host:port from target URL should be enough.
fddima
Master
 
Posts: 788
Joined: Tue Dec 07, 2010 6:10 am

Re: CefNavigationEntry::GetFaviconURLs()

Postby cretz » Wed Jul 12, 2017 3:35 pm

There's already a CefDisplayHandler::OnFaviconURLChange callback. Is there some reason that doesn't work for you?


I'm afraid not. What if the favicon URL doesn't change? What if some JS does pushState affecting the nav entries? Not sure...I haven't checked.

But even besides those things, if I saved the URL from OnFaviconURLChange, then someone did history.go(-2), how would I know that the URL in "two forwards" is that favicon I retrieved? I don't want to cache per URL because the same URL can have different "shortcut icon" meta tags.

I should dig through the Chrome source and see how they hold the favicons for nav entries, but I am not that familiar w/ the Chrome source, so It'd take me a bit.
cretz
Techie
 
Posts: 34
Joined: Mon Jun 26, 2017 11:41 am

Re: CefNavigationEntry::GetFaviconURLs()

Postby cretz » Wed Jul 12, 2017 3:50 pm

I have done some digging, and https://cs.chromium.org/chromium/src/co ... 473a&l=161 (wrapped by CefNavigationEntryImpl) seems to be able to return https://cs.chromium.org/chromium/src/co ... c1be771ce9. Granted I may have other needs for nav entries like post data (I still have to see how the popup for re-submitting form state when using history.go works).
cretz
Techie
 
Posts: 34
Joined: Mon Jun 26, 2017 11:41 am

Re: CefNavigationEntry::GetFaviconURLs()

Postby magreenblatt » Tue Jul 18, 2017 4:46 pm

Please add a bug. Pull requests welcome.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: CefNavigationEntry::GetFaviconURLs()

Postby cretz » Wed Jul 19, 2017 11:41 am

Thanks. Issue added: https://bitbucket.org/chromiumembedded/ ... avicons-to. I don't really have the chrome build env setup to send an immediate PR (and maybe not a powerful enough machine to support it, heh), but if I get a weekend free I may be able to tackle it, who knows.
cretz
Techie
 
Posts: 34
Joined: Mon Jun 26, 2017 11:41 am


Return to Feature Request Forum

Who is online

Users browsing this forum: No registered users and 20 guests