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

pdf.sandbox.js broken in non-TESTING builds #12912

Closed
Snuffleupagus opened this issue Jan 26, 2021 · 0 comments
Closed

pdf.sandbox.js broken in non-TESTING builds #12912

Snuffleupagus opened this issue Jan 26, 2021 · 0 comments
Assignees

Comments

@Snuffleupagus
Copy link
Collaborator

Snuffleupagus commented Jan 26, 2021

Attach (recommended) or Link to PDF file here: 160F-2019.pdf (from the repository).

Configuration:

Steps to reproduce the problem:

  1. Visit https://mozilla.github.io/pdf.js/web/viewer.html
  2. Open the web-console, and run PDFViewerApplication.preferences.set("enableScripting", true);
  3. Re-load the viewer
  4. Open, e.g. with drag-and-drop or the "Open File"-button, the 160F-2019.pdf file.
  5. Note how the pdf.sandbox.js file loads successfully, but trying to execute any code in the sandbox fails with:
    Quickjs -- TypeError: not a function                                        quickjs-eval.js:26:248
    

What is the expected behavior? (add screenshot)
The pdf.sandbox.js file both loads and correctly executes the code.

What went wrong? (add screenshot)
Errors in the QuickJS implementation, and scripting doesn't work.


Note that this can easily be reproduced locally, to aid debugging and manual testing, by simply:

Furthermore, it seems that this is somehow related to the TESTING build-flag, since if you instead run TESTING=true gulp generic everything works as expected. To me, this would suggest that the QuickJS code somehow (accidentally) depends on the value of parameters that's set when TESTING == true in https://github.com/mozilla/pdf.js/blob/master/src/pdf.sandbox.js

/cc @calixteman

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants