1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

Remove the ENABLE_SCRIPTING build-target, since it's not necessary

There's no really compelling reason, as far as I can tell, to introduce the `ENABLE_SCRIPTING` build-target, instead of simply re-using the existing `TESTING` build-target for the new `gulp integrationtest` task.

In general there should be no problem with just always enable scripting in TESTING-builds, and if I were to *guess* the reason that this didn't seem to work was most likely because the Preferences ended up over-writing the `AppOptions`.
As it turns out the GENERIC-viewer has already has built-in support for disabling of Preferences, via the `AppOptions`, and this can be utilized in TESTING-builds as well to ensure that whatever `AppOptions` are set they're always respected.
This commit is contained in:
Jonas Jenwald 2020-12-17 14:32:05 +01:00
parent eff4d8182d
commit c78f153bda
3 changed files with 21 additions and 43 deletions

View file

@ -67,7 +67,7 @@ const defaultOptions = {
},
enableScripting: {
/** @type {boolean} */
value: typeof PDFJSDev !== "undefined" && PDFJSDev.test("ENABLE_SCRIPTING"),
value: typeof PDFJSDev !== "undefined" && PDFJSDev.test("TESTING"),
kind: OptionKind.VIEWER + OptionKind.PREFERENCE,
},
enableWebGL: {
@ -249,7 +249,7 @@ if (
) {
defaultOptions.disablePreferences = {
/** @type {boolean} */
value: false,
value: typeof PDFJSDev !== "undefined" && PDFJSDev.test("TESTING"),
kind: OptionKind.VIEWER,
};
defaultOptions.locale = {
@ -260,8 +260,7 @@ if (
defaultOptions.sandboxBundleSrc = {
/** @type {string} */
value:
typeof PDFJSDev === "undefined" ||
PDFJSDev.test("!PRODUCTION && !ENABLE_SCRIPTING")
typeof PDFJSDev === "undefined" || !PDFJSDev.test("PRODUCTION")
? "../build/dev-sandbox/pdf.sandbox.js"
: "../build/pdf.sandbox.js",
kind: OptionKind.VIEWER,