Open nobicycle opened 6 years ago
The favicon should come from the zim file. Which ZIM file do you tals about?
Hello kelson42, Both the main page http://127.0.0.1:8086 and wikipedia for schools have the icon mentioned above.
Confirmed using kiwix-serve built from c6ace1eafc06bbe52d596f0905e50dac47000a7a (Tue Mar 27 12:03:21 2018 +0200), browsing into all ZIMs (old directory style and new single ZIM file) have no favicon in Pale Moon 27.9. An example ZIM would be 'askubuntu.com_en_all_2017-10.zim'. On the library page the relevant sites have the correct icons associated with their boxes.
I'm guessing that since I'm browsing one domain name (which in the kiwix sense hosts multiple ZIMs), PM will request the favicon just once for the library page, which won't have one?
https://github.com/kiwix/libkiwix/issues/471 secures we will have a favicon in kiwix-serve welcome page. But the favicon for each content should be managed in each ZIM. An here there is a lot to do as well. For the moment this is really not done properly in zimcheck and not in the scrapers either. We will have to improve that, but not sure exactly how. I will think about it in the next days.
Hello, I am a beginner and would like to work on this issue, please guide me how set up a development environment and check out this issue
@veloman-yunkan Do you know how we could have a proper favicon for the browser with the iframe based viewer?
@veloman-yunkan Do you know how we could have a proper favicon for the browser with the iframe based viewer?
@kelson42 No. I don't think it's possible (at least, not easy) to have a content dependent favicon in iframe based viewer.
But the favicon for each content should be managed in each ZIM. An here there is a lot to do as well. For the moment this is really not done properly in zimcheck and not in the scrapers either. We will have to improve that, but not sure exactly how. I will think about it in the next days.
Where is the icon at https://library.kiwix.org taken from?
@JensKorte Honestly not sure, from commons.wikimedia.org probably. Any problem with it?
@JensKorte Honestly not sure, from commons.wikimedia.org probably. Any problem with it?
No, I like them.
But the favicon for each content should be managed in each ZIM. An here there is a lot to do as well. For the moment this is really not done properly in zimcheck and not in the scrapers either. We will have to improve that, but not sure exactly how. I will think about it in the next days.
I thought the icons at the library site could be used in the zim file.
@veloman-yunkan Do you know how we could have a proper favicon for the browser with the iframe based viewer?
@kelson42 No. I don't think it's possible (at least, not easy) to have a content dependent favicon in iframe based viewer.
It's possible to retrieve the <iframe>
's icon and apply it to the main page, using JS. That's what zimit does. It's using a SW message but that's not required. Code can register a handler for the load event then query its DOM.
Where is the icon at https://library.kiwix.org/ taken from?
library.kiwix.org has a default icon (/favicon.ico
) so whenever there's no semantic icon defined, it displays it.
Where is the icon at https://library.kiwix.org/ taken from?
library.kiwix.org has a default icon (
/favicon.ico
) so whenever there's no semantic icon defined, it displays it.
Welcome page favicon(s) have been fixed recently, see https://github.com/kiwix/libkiwix/pull/805. That part works fine IMO. The problem is once we move to ZIM content.
Where is the icon at https://library.kiwix.org/ taken from?
library.kiwix.org has a default icon (
/favicon.ico
) so whenever there's no semantic icon defined, it displays it.Welcome page favicon(s) have been fixed recently, see kiwix/libkiwix#805. That part works fine IMO. The problem is once we move to ZIM content.
As I wrote, favicon.ico
is a default that browsers tries in case there's no better option. So kiwix-serve could simply respond to favicon.ico
with its favicon and that would mean all pages (content or not) would have a favicon.
As I wrote,
favicon.ico
is a default that browsers tries in case there's no better option. So kiwix-serve could simply respond tofavicon.ico
with its favicon and that would mean all pages (content or not) would have a favicon.
Not in favour of that. Would be better than what we have today, but is not what I expect.
I don't think you've expressed what you expect. This trick is super cheap and would bring some value.
Now if you want to have meaningful icons for content, because of how the player works it's easy to:
Illustration_48x48
. It may not render great as this would be the browser resizing (cubic) but you'd have content-aware icons everywhere.None of this prevent the side effort of improving scrapers to make sure they provide favicons.
@kelson42 No. I don't think it's possible (at least, not easy) to have a content dependent favicon in iframe based viewer.
It's possible to retrieve the
<iframe>
's icon and apply it to the main page, using JS. That's what zimit does. It's using a SW message but that's not required. Code can register a handler for the load event then query its DOM.
@rgaudin Thanks! At the time I couldn't figure out a way of dynamically changing the favicon. I looked for standardized JS API and didn't find one. I completely neglected the possibility that it could be done by manipulating links in the <head>
section.
I think that in addition to what rgaudin suggested, it could be pretty cheap for kiwix-serve to transform the Illustration_48x48@1
into a real favicon on-the-fly for all requests to favicon.ico
on a given content when it does not find favicon.ico
inside the ZIM.
Hi, I would like kiwix-server to have a favicon in the browser The black icon is what represents kiwix-serve at the moment. How to change it? (under Linux, if that is relevant)