diff --git a/extensions/chromium/preferences_schema.json b/extensions/chromium/preferences_schema.json index 17a67f90a..d6eb5d89b 100644 --- a/extensions/chromium/preferences_schema.json +++ b/extensions/chromium/preferences_schema.json @@ -133,14 +133,6 @@ "description": "Whether to prevent the extension from reporting the extension and browser version to the extension developers.", "default": false }, - "renderer": { - "type": "string", - "enum": [ - "canvas", - "svg" - ], - "default": "canvas" - }, "renderInteractiveForms": { "type": "boolean", "default": true diff --git a/src/display/svg.js b/src/display/svg.js index d61f184bf..e83d14abd 100644 --- a/src/display/svg.js +++ b/src/display/svg.js @@ -22,6 +22,7 @@ import { isNum, OPS, TextRenderingMode, + unreachable, Util, warn, } from "../shared/util.js"; @@ -29,11 +30,16 @@ import { DOMSVGFactory } from "./display_utils.js"; import { isNodeJS } from "../shared/is_node.js"; /** @type {any} */ -let SVGGraphics = function () { - throw new Error("Not implemented: SVGGraphics"); +let SVGGraphics = class { + constructor() { + unreachable("Not implemented: SVGGraphics"); + } }; -if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) { +if ( + typeof PDFJSDev === "undefined" || + PDFJSDev.test("!PRODUCTION || GENERIC") +) { const SVG_DEFAULTS = { fontStyle: "normal", fontWeight: "normal", @@ -438,8 +444,7 @@ if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) { let maskCount = 0; let shadingCount = 0; - // eslint-disable-next-line no-shadow - SVGGraphics = class SVGGraphics { + SVGGraphics = class { constructor(commonObjs, objs, forceDataSchema = false) { this.svgFactory = new DOMSVGFactory(); diff --git a/web/app_options.js b/web/app_options.js index 250cdf0b7..b52b4edcf 100644 --- a/web/app_options.js +++ b/web/app_options.js @@ -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} */