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

Add minimum version boundary for PDF.js #7619

Open
The-Compiler opened this issue Mar 14, 2023 · 2 comments
Open

Add minimum version boundary for PDF.js #7619

The-Compiler opened this issue Mar 14, 2023 · 2 comments
Labels
component: style / refactoring Issues related to coding styles or code that should be refactored. priority: 2 - low Issues which are currently not very important.

Comments

@The-Compiler
Copy link
Member

If we decide to keep PDF.js support after #4911, we should introduce a minimum version we are willing to support. Right now, we still have code to support PDF.js v1, while v2 has been out since 2018.

Especially when getting into more advanced features (#1916 et al) we should really decide what we actually want to test (even if manually) and support. Probably needs a survey of which versions are even commonly packaged (e.g. on Ubuntu/Debian).

@The-Compiler The-Compiler added component: style / refactoring Issues related to coding styles or code that should be refactored. priority: 2 - low Issues which are currently not very important. labels Mar 14, 2023
The-Compiler added a commit that referenced this issue Mar 14, 2023
A quick tour through the PDF.js API:

v1.0.1040 introduced the ability to pass an object to PDFView.open()
instead of passing an URL:
mozilla/pdf.js#5254

v1.6.210 (?) renamed PDFView to PDFViewerApplication:
ffa276a

v3.3.122 made it mandatory to pass an object (and also made originalURL
optional when doing so):
mozilla/pdf.js#15972

We should probably properly get rid of old version support at some point
(see #7619), but until then, I *think* this approach should work with
older versions still.

Fixes #7618
The-Compiler added a commit that referenced this issue Mar 14, 2023
A quick tour through the PDF.js API:

v1.0.1040 introduced the ability to pass an object to PDFView.open()
instead of passing an URL:
mozilla/pdf.js#5254

v1.6.210 (?) renamed PDFView to PDFViewerApplication:
ffa276a

v3.3.122 made it mandatory to pass an object (and also made originalURL
optional when doing so):
mozilla/pdf.js#15972

We should probably properly get rid of old version support at some point
(see #7619), but until then, I *think* this approach should work with
older versions still.

Fixes #7618

(cherry picked from commit 924a7a5)
@OmeletWithoutEgg
Copy link

Is PDFium really working? When following the instructions in #4911 (comment), I got some js error saying

Unchecked runtime.lastError: Streams are only available from a mime handler view guest.
browser_api.js:151 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'tabId')
    at browser_api.js:151:24

An example URL: chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/index.html?https://africau.edu/images/default/sample.pdf
Opening this URL with google chrome results in the same error.

Or what is the correct way to use PDFium in qutebrowser?

@The-Compiler
Copy link
Member Author

@OmeletWithoutEgg Please don't use comments on unrelated issues for support questions. If anything this belongs in #4911 - but in either case, this is unsupported (which is why #4911 is still open), and it's entirely possible it worked at some point but does not anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: style / refactoring Issues related to coding styles or code that should be refactored. priority: 2 - low Issues which are currently not very important.
Projects
None yet
Development

No branches or pull requests

2 participants