kiwix / kiwix-apple

Kiwix for offline access on iOS and macOS
https://apple.kiwix.org
GNU Lesser General Public License v3.0
441 stars 70 forks source link

PDF in Nautilus made ZIM are not open via simple click #775

Closed kelson42 closed 1 week ago

kelson42 commented 3 weeks ago

Clicking on the PDF logo allows to display (in a new tab) the PDF file: https://library.kiwix.org/viewer#zimgit-water_en_2024-05/home

But with iOS, nothing happens if I do the same

image

Not sure if macOS is impacted!

I suspect the bug is linked to the fact that this should open in a new tab.

BPerlakiH commented 2 weeks ago

I did tested this on iPad OS 17.4.1, and it is working as expected (as of todays main branch):

https://github.com/kiwix/kiwix-apple/assets/6784320/cdbbb046-9a93-4bf0-9a11-7c8bdb540654

BPerlakiH commented 2 weeks ago

I also tested this on macOS Sonoma 14.5, and it works there as well. The PDF can be opened by directly clicking on the icon, right-clicking and "open in new window", and also works with Cmd+click.

kelson42 commented 2 weeks ago

@BPerlakiH Very very strange, you confirm that at beginning of the video, you make a simple touch of the first PDF logo? You also test with latest testflight?

BPerlakiH commented 2 weeks ago

Ok, it seems to be a content issue. The content form 7 August does work, whereas the new one from 25 May does not.

The difference I can see is in the links:

25 May

<span class="icon">
        <a target="_blank" href="files/Water (2).pdf" data-doc-id="00001" data-popup="0" class="btn btn-neutral">
          <img src="vendors/ext-icons/pdf.svg">
        </a>
      </span>

7 Aug

<span class="icon">
        <a href="files/Water (1).pdf" data-doc-id="00000" data-popup="0" class="btn btn-neutral">
          <img src="vendors/ext-icons/pdf.svg">
        </a>
      </span>

it seems by the first sight that: target="_blank" might be the cause of this.

kelson42 commented 2 weeks ago

We have implemented the target=¨_blank¨ because we were suffering of https://github.com/openzim/nautilus/issues/71 and this sounded to be the best workaround.

benoit74 commented 2 weeks ago

target="_blank" are also present in zimit ZIMs. I think we should support these href since on some readers (e.g. kiwix-serve) they make sense so I see no reason to not keep them for the readers which could benefit from this information.

kelson42 commented 2 weeks ago

Whatever Zimit or Nautlis based, there is a clear agreement that the HTML feature should be supported in Kiwix.

BPerlakiH commented 2 weeks ago

I can confirm that this is iOS specific only, the same ZIM file is working OK on macOS.

kelson42 commented 2 weeks ago

Indon’t think this is properly implemented:

image