Skip to content
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

[Feature Request] Opening URLs without the extension #20

Open
Trisplus opened this issue Sep 11, 2024 · 3 comments
Open

[Feature Request] Opening URLs without the extension #20

Trisplus opened this issue Sep 11, 2024 · 3 comments
Labels
enhancement New feature or request future Todo sometime later

Comments

@Trisplus
Copy link

Will it be possible to add a feature namely "Enter Url" on doqment web viewer https://shivaprsd.github.io/doqment/src/pdfjs/web/viewer.html ?

It will ask user to enter any url which contain pdf. Then, it will show the pdf to user on web, like we see when we go to the demo pdf.js link.

This will help those android browser user, which has no extension support (like chrome android).

Thanks.

@shivaprsd
Copy link
Owner

shivaprsd commented Sep 13, 2024

@Trisplus I can add a URL box, but unfortunately it won't work as expected.

Websites are restricted by the same-origin policy, which does not allow a web page located at shivaprsd.github.io to load a url (the PDF) in a different domain. It would work if the server hosting the PDF sends a CORS header with the response, which is not generally the case. The demo page works because it is on the same domain as the viewer.

There are workarounds, like hosting a proxy server that would simply add the needed headers. But then it becomes too complicated for a GitHub page, which is only intended to be a demo.

I am thinking about ways to support Chrome Android. For the moment you can workaround by opening the URL (which downloads the PDF to your phone) and manually open it in the demo by clicking and then Open.

@shivaprsd shivaprsd changed the title [Feature Request] PDF viewing from any url on web. [Feature Request] Opening URLs without the extension Sep 13, 2024
@shivaprsd shivaprsd added enhancement New feature or request future Todo sometime later labels Sep 13, 2024
@Trisplus
Copy link
Author

Trisplus commented Sep 14, 2024

Thanks for the clarification.

You can make an android app based on doqment pdf reader.

However, downloaded pdfs are kind of messy to me and you have to delete one by one, which is doable but worth extra time, if you have tons of pdfs.

Btw, chrome for android will soon implement native pdf viewer, there is a flag named #android-open-pdf-inline, which is being worked here by this man.
Thanks again.

@shivaprsd
Copy link
Owner

shivaprsd commented Sep 17, 2024

downloaded pdfs are kind of messy

I agree strongly. I suggested it only as a last resort. BTW there are also Chromium variants for Android that do support extensions, but doqment has issues in them (#19).

You can make an android app based on doqment

I was also thinking along the same lines. But my experience with Android development has not been the best...

chrome for android will soon implement native pdf viewer

Nice! Only if they also added extension support... 😒

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request future Todo sometime later
Projects
None yet
Development

No branches or pull requests

2 participants