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: Read externally hosted PDFs by URL instead of upload (Firefox) #395

Open
ArtofBugs opened this issue May 5, 2024 · 5 comments
Labels

Comments

@ArtofBugs
Copy link

For the PDF viewer, it would be nice if we could enter a URL for a non-local PDF. For example, if I want to read https://docs.house.gov/billsthisweek/20240429/HR%204866%20-Garcia.pdf, I have to

  1. have my tab redirected to the lsd reader page
  2. go back a page to get back to the PDF
  3. download the PDF
  4. go back to the lsd reader
  5. upload the PDF there.

(Cryptically, some pages, like https://arxiv.org/pdf/1910.11099, give a "missing host permissions for the tab" error and don't redirect to the lsd reader at all, but I'd assume this falls under the same thing.)

It would be faster if there was a way to just enter the URL of the PDF page on the lsd reader page (or if the additional permissions are enabled, grab the URL automatically before the redirect).

@ken107
Copy link
Owner

ken107 commented Jun 26, 2024

Have you tried simply clicking on the Read Aloud icon when you're at the URL https://docs.house.gov/billsthisweek/20240429/HR%204866%20-Garcia.pdf ? It should work without your having to go through the steps above. I just tried and it seems to work fine.

@ken107 ken107 closed this as not planned Won't fix, can't repro, duplicate, stale Jun 26, 2024
@ArtofBugs
Copy link
Author

Have you tried simply clicking on the Read Aloud icon when you're at the URL https://docs.house.gov/billsthisweek/20240429/HR%204866%20-Garcia.pdf ? It should work without your having to go through the steps above. I just tried and it seems to work fine.

Yes I tried that first; it does not work for me.

@ArtofBugs
Copy link
Author

I am on the latest version of Firefox; clicking the Read Aloud icon takes me to the pdf upload page instead of reading aloud the page.

@ArtofBugs ArtofBugs changed the title Feature Request: Read externally hosted PDFs Feature Request: Read externally hosted PDFs by URL instead of upload Jun 26, 2024
@ArtofBugs
Copy link
Author

@ken107 were you able to reproduce the error for the ArXiv link I mentioned above? Here it is again if you missed it: https://arxiv.org/pdf/1910.11099

@ken107
Copy link
Owner

ken107 commented Jun 27, 2024

Ah, thanks for clarifying. I remember now. On Firefox, security prevents us from injecting code into the built-in PDF viewer page to load our own PDF viewer on top (the way we make it work on Chromium browsers). So we fall back to redirecting the user to the standalone viewer. The standalone viewer cannot open externally hosted PDF files from other websites due to cross-origin restrictions, hence the unfortunate steps you have to go through to make it work.

But thinking about it now, there may be a convoluted way to solve this. The extension reads the PDF file in the background, create a blob URL from it, and hands it down to the standalone viewer. The extension, if required, will need to request origin-permission to be able to read the PDF file.

@ken107 ken107 reopened this Jun 27, 2024
@ken107 ken107 changed the title Feature Request: Read externally hosted PDFs by URL instead of upload Feature Request: Read externally hosted PDFs by URL instead of upload (Firefox) Jun 27, 2024
@ken107 ken107 added the firefox label Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants