-
-
Notifications
You must be signed in to change notification settings - Fork 148
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
Make kiwix-js work from file:/// on Chrome in jQuery mode #286
Comments
Different browsers have different security policies and implementation. But this src attribute is necessary for the ServiceWorker mode. Or at least it's the only way we had found to make it work at that moment. |
Ah, OK. I assumed one obvious use for the app would be to distribute along with a ZIM file so that it could be run on any end-user's computer just by launching index.html, without installing apps or going to stores. As Chrome is a popular browser, it would be a shame for it not to work this way. Maybe we can programmatically change the "src" attribute if the user is running Chrome and has not set/enabled ServiceWorker mode. |
Start chrome with the --allow-file-access-from-files flag. I have two shortcuts on desktop. One I call localChrome with the flag set and the other without. This has been discussed before in multiple places just search for "--allow-file-access-from-files" from issues search. |
Thanks @sharun-s , I did search for the issue first, looking at all issues mentioning "Chrome" in the title, but I must have searched wrong. Nevertheless, this behaviour is not acceptable for an end-user, except as a last resort. If we have no better solution, we need a warning to pop up if Chrome is detected (a bit like the "It looks like you're using Android" message) to explain how to use the app with Chrome. |
The use case is places with no internet access but a computer exists. On Windows all they need is the src folder, with a shortcut to Chrome with the flag set and a ZIM file. The choice of Chrome currently over Edge or Firefox is that the ZIM file (archive object) can be preset in the code see #275 No config reqd. |
@sharun-s Another option is to deploy the browser extension (which can be done offline with the files from http://download.kiwix.org/bin/browsers/ ). But I'm for trying to make it work from file:/// : it would at least help us debugging |
The browsers in which it works from file:/// with no extra fiddling or packaging are Firefox, Internet Explorer and Edge. In IE a bar pops up asking you to allow access, but it's a simple click. FF and Edge both work as is. It would be great to be able to claim universality across the great majority of browsers. If it's just an "src" tag standing in the way, then it doesn't seem like a big problem, especially if the web worker solution proves as good as or better than service workers. |
This is a good reason to continue experimenting with ways of eliminating dummyArticle. I'm just cross-referencing to #347 where some work on this has been logged. |
Also #341 where I logged the results of different ways of voiding the iframe, some not using the src attribute of the iframe. |
I don't think this issue is achievable. There is a flag in Chromium, and this is as far as we can get. Closing. |
Excuse my naivety, but I don't use Chrome on my main machine for various reasons (principally the number of "phone home" background services it installs on Windows). However I've installed on a secondary machine for testing Version 59.0.3071.115 (Official Build) (64-bit) for Windows 10. So I'm shocked to find that kiwix-js (main) refuses to show the selected ZIM file article when index.html is run from the file system (i.e., not served). Since Edge, Firefox and IE all run kiwix-js fine from the FS, I wonder if I'm doing something wrong or failing to set some flag. The ZIM file loads, because the search box works, but no page (article) is ever shown, and I get this exception when trying to move between tabs in the app:
Line 135 of app.js is
$("#articleContent").contents().empty();
. Sorry if this is "obvious", but I'd have also thought it's a major use case to be able to download the files and run in a browser without installing node.js or a web server, etc.... ? NB this is failing against kiwix-js main branch, nothing to do with my Preload stylesheets branch. Standard Windows 10 Pro 64bit. (PS I realize this is caused by https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy , but why only this browser?)The text was updated successfully, but these errors were encountered: