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

Ensure that the pdf.sandbox.js is removed from the DOM on destroy, and unbreak the Chromium-extension (PR 12695 follow-up) #12703

Merged

Conversation

Snuffleupagus
Copy link
Collaborator

No description provided.

@timvandermeij
Copy link
Contributor

/botio-linux preview

@pdfjsbot
Copy link

pdfjsbot commented Dec 7, 2020

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/dcc7cf2aeabf72c/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Dec 7, 2020

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/dcc7cf2aeabf72c/output.txt

Total script time: 4.34 mins

Published

@brendandahl
Copy link
Contributor

I think this will collide with #12689.

Copy link
Member

@Rob--W Rob--W left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change looks reasonable and smaller than #12689, so I think that it would be better to land this first. The other patch is not close to landing yet.

@Snuffleupagus Snuffleupagus force-pushed the GenericScripting-rm-scriptElement branch from bc92642 to 294ed33 Compare December 9, 2020 21:12
@Snuffleupagus Snuffleupagus requested a review from Rob--W December 9, 2020 21:14
…he DOM (PR 12695 follow-up)

I completely missed this previously, but we obviously should remove the scriptElement as well to *really* clean-up everything properly.

Given that there's multiple existing usages of `loadScript` in the code-base, the safest/quickest solution seemed to be to have call-sites opt-in to remove the scriptElement using a new parameter.
…d into its own helper method

Since the `close` method has become quite large, this small re-factoring shouldn't hurt.
…close` and into its own helper method

Since the `close` method has become quite large, this small re-factoring shouldn't hurt (and may also be useful with future changes to the `_initializeJavaScript` method).
…e used in the Chromium-extension

While it's not entirely clear to me that it's ultimately desirable to use the `pdf.sandbox.js` in the Chromium-extension, given that the MOZCENTRAL-build uses `pdf.scripting.js` directly in a *custom* sandbox, the current state isn't that great since setting `enableScripting = true` with the Chromium-extension will currently fail completely.

Hence this patch, which should at least unbreak things for now.
…mplementations, to a `createScripting` method

Given that the GENERIC default viewer supports opening more than one document, and that a unique scripting-instance is now used for each document, the changes made in this patch seem appropriate.
@Snuffleupagus Snuffleupagus force-pushed the GenericScripting-rm-scriptElement branch from 294ed33 to 6218b9a Compare December 9, 2020 21:16
@timvandermeij
Copy link
Contributor

/botio-linux preview

@pdfjsbot
Copy link

pdfjsbot commented Dec 9, 2020

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/4dec2e3b1d5048e/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Dec 9, 2020

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/4dec2e3b1d5048e/output.txt

Total script time: 4.16 mins

Published

@timvandermeij timvandermeij merged commit 0629a8f into mozilla:master Dec 9, 2020
@timvandermeij
Copy link
Contributor

Looks like a good set of improvements to me too. Thanks!

@Snuffleupagus Snuffleupagus deleted the GenericScripting-rm-scriptElement branch December 10, 2020 10:19
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.

5 participants