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

Only include the renderer-preference in builds where SVGGraphics is defined

After PR 13117 it's now (finally) possible for *different* build targets to specify individual options/preferences, and we can utilize that to only expose the `renderer`-preference in builds where `SVGGraphics` is actually defined.
Note that for e.g. `MOZCENTRAL`-builds, trying to enable SVG-rendering will throw immediately and the preference thus doesn't make sense to include there.

Also, update the dummy `SVGGraphics` to use a class, tweak the `PDFJSDev`-check in `src/display/svg.js` to agree fully with the option/preference, and remove an unnecessary `eslint-disable`.
This commit is contained in:
Jonas Jenwald 2021-05-10 11:33:06 +02:00
parent f07d50f8ee
commit 7548dc5ea2
3 changed files with 13 additions and 20 deletions

View file

@ -52,9 +52,6 @@ const defaultOptions = {
value: false,
kind: OptionKind.VIEWER + OptionKind.PREFERENCE,
},
/**
* The `disablePreferences` is, conditionally, defined below.
*/
enablePermissions: {
/** @type {boolean} */
value: false,
@ -95,9 +92,6 @@ const defaultOptions = {
value: "./images/",
kind: OptionKind.VIEWER,
},
/**
* The `locale` is, conditionally, defined below.
*/
maxCanvasPixels: {
/** @type {number} */
value: 16777216,
@ -117,7 +111,7 @@ const defaultOptions = {
renderer: {
/** @type {string} */
value: "canvas",
kind: OptionKind.VIEWER + OptionKind.PREFERENCE,
kind: OptionKind.VIEWER,
},
renderInteractiveForms: {
/** @type {boolean} */
@ -265,6 +259,8 @@ if (
: "../build/pdf.sandbox.js",
kind: OptionKind.VIEWER,
};
defaultOptions.renderer.kind += OptionKind.PREFERENCE;
} else if (PDFJSDev.test("CHROME")) {
defaultOptions.disableTelemetry = {
/** @type {boolean} */