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

Detect scripted auto-print requests #6236

Merged
merged 1 commit into from
Jul 25, 2015

Conversation

Rob--W
Copy link
Member

@Rob--W Rob--W commented Jul 20, 2015

Fixes #6106

As usual, see the commit mesage for a detailed explanation.

To test whether the changes work:

  1. node server
  2. Visit http://localhost:8888/test/unit/unit_test.html?spec=api

To manually test whether the changes work:

  1. node server
  2. Open http://localhost:8888/web/viewer.html?file=/test/pdfs/bug1001080.pdf
    and check whether a print dialog opens
  3. Idem for http://localhost:8888/web/viewer.html?file=/test/pdfs/issue6106.pdf

Fixes mozilla#6106

To avoid future regressions, two new unit tests were added:
1. A new PDF based on the report from mozilla#6106, which contains an
   OpenAction of type JavaScript and a string "this.print({...}".
2. An existing PDF from https://bugzil.la/1001080 (from mozilla#4698).

Although it does not matter, since we don't execute the JavaScript code,
I have also changed "print(true)" to "print({})" since the print method
takes an object (not a boolean). See "Printing PDF documents", page 62:
http://adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/js_developer_guide.pdf
@timvandermeij
Copy link
Contributor

/botio-linux preview

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

Command cmd_preview from @timvandermeij received. Current queue size: 0

Live output at: http://107.21.233.14:8877/c01c3b55fa12e01/output.txt

@timvandermeij
Copy link
Contributor

/botio test

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

Command cmd_test from @timvandermeij received. Current queue size: 0

Live output at: http://107.21.233.14:8877/e952f4992022b51/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux)


Success

Full output at http://107.21.233.14:8877/e952f4992022b51/output.txt

Total script time: 18.66 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: Passed

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_test from @timvandermeij received. Current queue size: 0

Live output at: http://107.22.172.223:8877/655ac8acc6d6c9f/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://107.22.172.223:8877/655ac8acc6d6c9f/output.txt

Total script time: 18.41 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: Passed

timvandermeij added a commit that referenced this pull request Jul 25, 2015
Detect scripted auto-print requests
@timvandermeij timvandermeij merged commit d08895d into mozilla:master Jul 25, 2015
@timvandermeij
Copy link
Contributor

Awesome, thank you!

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

Successfully merging this pull request may close these issues.

3 participants