kiwix-js
kiwix-js copied to clipboard
The window title should be set to the article title (coming from the iframe)
This way setting bookmarks and finding the the right tab when multiple tabs are open gets more user friendly. Right now it is just set to Kiwix.
I suppose you're talking about the title tag of the whole window/tab, because the title tag of the iframe is already set (by the content itself), and mostly unused. It's probably easy to read it from the iframe and set it to the window.
Regarding handling bookmarks, it would also require to read and handle this URL parameter, to read and display the corresponding content. But we once again face the issue of ZIM file selection, that must be done by the user before anything else.
Yup should be a easy fix. Maybe the kiwi favicon can be added too. I just logged it to not forget. I have a couple bookmarks setup in the bookmark bar using the #275 url technique. Using it mostly for testing.
We need to do that in a generic way, that would be compatible with any content injection mode (jQuery, ServiceWorker, etc). Maybe something like https://stackoverflow.com/questions/2429045/iframe-src-change-event-detection#answer-24726977 would work : observing the title tag of the iframe content, and change the window title when it is modified
I would like to work on this issue
I think we need to give a bit of thought to what the effect of this in app context would be. In browser context, it might make sense, but are we sure it's what is required in app context, including extensions? Apps are often separate processes that run in a framework, with the title set by an app manifest, and the app's window title and icon should be stable. If, when running in browser context, we think of Kiwix still as an app, then we probably shouldn't mess with the window title. It would be good to clarify our aims when running Kiwix in browser context.
Yes, it won't be good to set the title in app manifest..that won't look good I guess but on browser it will provide readability and more convenience when more than two tabs are opened. Just an example - Google Colab also provides with same feature - the tab name is updated with the notebook name on which the user is working which is really helpful at times.
@Jaifroid : maybe we could let @vasusharma7 implement it, if it's not long/complicated. It would let us all see what the implications would be in all contexts.
Yes, of course!
Thanks for guiding.I will implement the changes and let you know soon.