Merge pull request #12773 from Snuffleupagus/move-sandboxBundleSrc

Pass in the "sandboxBundleSrc" option when calling `DefaultExternalServices.createScripting`
This commit is contained in:
calixteman 2020-12-24 02:50:04 -08:00 committed by GitHub
commit df53e7811c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 14 additions and 10 deletions

View file

@ -167,7 +167,7 @@ class DefaultExternalServices {
throw new Error("Not implemented: createL10n");
}
static createScripting() {
static createScripting(options) {
throw new Error("Not implemented: createScripting");
}
@ -1477,7 +1477,12 @@ const PDFViewerApplication = {
if (pdfDocument !== this.pdfDocument) {
return; // The document was closed while the data resolved.
}
const scripting = this.externalServices.createScripting();
const scripting = this.externalServices.createScripting(
typeof PDFJSDev === "undefined" ||
PDFJSDev.test("!PRODUCTION || GENERIC || CHROME")
? { sandboxBundleSrc: AppOptions.get("sandboxBundleSrc") }
: null
);
// Store a reference to the current scripting-instance, to allow destruction
// of the sandbox and removal of the event listeners at document closing.
const internalEvents = new Map(),