kiwix-js-pwa icon indicating copy to clipboard operation
kiwix-js-pwa copied to clipboard

Have several ZIMs open at the same time

Open Inbefortus opened this issue 2 years ago • 9 comments

As yet, merely one ZIM file can be open. If you want to read something in another ZIM file, you have to close the current ZIM file to open the other one.

It would be great if you could open multiple ZIM files so that you can always switch between them expeditiously.

Inbefortus avatar Dec 21 '21 14:12 Inbefortus

@Inbefortus Thank you for the suggestion. Have you tried the Select Folder option when picking your ZIM archives? If you put several archives into a folder, ideally without anything else in that folder (i.e. a dedicated folder for ZIM archives), then it is very fast to switch between ZIMs. Granted, this is about ease of switching, not about having two open at the same time (which is possible, as I'll explain shortly).

Jaifroid avatar Dec 21 '21 15:12 Jaifroid

How to open two windows with different ZIMs loaded in each (this is just one method I've tested):

  1. Install the PWA version (using Chrome or Edge);
  2. Pin the icon to the taskbar;
  3. Launch an instance from the icon, and open a ZIM;
  4. Right-click the icon, and choose "Kiwix JS PWA Edition"
  5. It should open a second window (you might need to drag it from on top of the original window, as by default it will have the same size and position);
  6. In the second window, go to Configuration and open a different ZIM. See screenshot for the result.

image

Jaifroid avatar Dec 21 '21 15:12 Jaifroid

Have you tried the Select Folder option when picking your ZIM archives? If you put several archives into a folder, ideally without anything else in that folder (i.e. a dedicated folder for ZIM archives), then it is very fast to switch between ZIMs.

@Jaifroid Yes, I have tried that as well. Either I'm doing something wrong or it's exactly the same, because I have to do the same steps as usual to change the ZIM, although I did it this way. This is not even that big of a problem. I rather meant that it is inconvenient to have to change one ZIM for another.

By the way, I am always running Android 10.

How to open two windows with different ZIMs loaded in each (this is just one method I've tested):

I couldn't quite follow you here, but I still managed to do it another way. :) Thank you for your assistance, though. Now I just need to find a solution to remove this white flashing in Google Chrome, otherwise, I'll have to say goodbye to Chrome so as not to ruin my eyes.

It would have been fantastic if there was also a solution for Samsung Internet. I imagined that you could open a new tab and then just open a second ZIM in that tab, basically an individual built-in tab system without ever having to run multiple instances.

Inbefortus avatar Dec 21 '21 18:12 Inbefortus

@Inbefortus I'll check out Samsung Internet to see what's possible.

Jaifroid avatar Dec 21 '21 21:12 Jaifroid

image

Jaifroid avatar Jan 13 '22 17:01 Jaifroid

@Jaifroid I know, a little late....

If I'm not mistaken, in the image, you are running multiple instances of the same app on a PC. The problem is that you can't just open multiple instances of an app in Android. It would be enough if you could open several tabs in the same instance (Samsung Internet), so that you can open a number of individual ZIM files in each tab. :)

Inbefortus avatar Jan 31 '22 16:01 Inbefortus

@Inbefortus Indeed, that is on a PC.

The problem would be switching between files without the user picking the archive again. Chrome/Samsung on Android doesn't support the File System Access API, so each ZIM has to be picked one-by-one rather than picking a Directory of ZIMs. On a PC, the File System Access API is supported (in Chromium browsers), so this is possible without re-picking the file for each ZIM.

It might be possible to pick several ZIM archives in one go, and get the browser to keep separate references to each one. But we'd need to create a tab interface especially for this...

Jaifroid avatar Feb 01 '22 10:02 Jaifroid

The problem would be switching between files without the user picking the archive again. Chrome/Samsung on Android doesn't support the File System Access API, so each ZIM has to be picked one-by-one rather than picking a Directory of ZIMs. On a PC, the File System Access API is supported (in Chromium browsers), so this is possible without re-picking the file for each ZIM.

Okay, that declares a lot.

It might be possible to pick several ZIM archives in one go, and get the browser to keep separate references to each one. But we'd need to create a tab interface especially for this...

If this takes a lot of effort, then we could put it on the to-do list first until other users take notice of this and report the same. What do you think?

Inbefortus avatar Feb 01 '22 10:02 Inbefortus

Somewhat related to this issue would be #287, which would require the browser to hold separate references to two or more ZIM archives. It would be a big infrastructure change despite the object model used in the app.

Jaifroid avatar Sep 05 '22 17:09 Jaifroid

Closed via https://github.com/kiwix/kiwix-js-pwa/commit/17c9312a005ba20ffbbded31b95b0272f563aead. It is now supported to have multiple instances of the app open in different browser tabs or windows, each with different ZIMs loaded. On Windows and Linux, this works well, and the File Handling API also will open the PWA in its own instance for each file launched from the system File explorer. On Android, it is possible to open multiple instances in different browser tabs, but attempting to open an installed PWA more than once reverts to the already open instance. Unfortunately, the latter behaviour on Android is a system limitation, not something the app can work around. If the system supports it, it will now work seamlessly with the app.

Jaifroid avatar Nov 08 '23 11:11 Jaifroid