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

[api-minor] Enable enableAutoLinking by default

It's already enabled by default in Firefox, and since there's no open issues regarding auto-linking I suppose that we can attempt to enable it unconditionally.
This commit is contained in:
Jonas Jenwald 2025-03-21 11:35:50 +01:00
parent 8f4c0169a0
commit abcddb51e0
4 changed files with 8 additions and 8 deletions

View file

@ -228,7 +228,7 @@
"enableAutoLinking": { "enableAutoLinking": {
"description": "Enable creation of hyperlinks from text that look like URLs.", "description": "Enable creation of hyperlinks from text that look like URLs.",
"type": "boolean", "type": "boolean",
"default": false "default": true
} }
} }
} }

View file

@ -202,7 +202,7 @@ const defaultOptions = {
}, },
enableAutoLinking: { enableAutoLinking: {
/** @type {boolean} */ /** @type {boolean} */
value: typeof PDFJSDev === "undefined" || PDFJSDev.test("MOZCENTRAL"), value: true,
kind: OptionKind.VIEWER + OptionKind.PREFERENCE, kind: OptionKind.VIEWER + OptionKind.PREFERENCE,
}, },
enableDetailCanvas: { enableDetailCanvas: {

View file

@ -95,7 +95,7 @@ import { XfaLayerBuilder } from "./xfa_layer_builder.js";
* @property {boolean} [enableHWA] - Enables hardware acceleration for * @property {boolean} [enableHWA] - Enables hardware acceleration for
* rendering. The default value is `false`. * rendering. The default value is `false`.
* @property {boolean} [enableAutoLinking] - Enable creation of hyperlinks from * @property {boolean} [enableAutoLinking] - Enable creation of hyperlinks from
* text that look like URLs. The default value is `false`. * text that look like URLs. The default value is `true`.
*/ */
const DEFAULT_LAYER_PROPERTIES = const DEFAULT_LAYER_PROPERTIES =
@ -130,7 +130,7 @@ class PDFPageView extends BasePDFPageView {
#canvasWrapper = null; #canvasWrapper = null;
#enableAutoLinking = false; #enableAutoLinking = true;
#hasRestrictedScaling = false; #hasRestrictedScaling = false;
@ -188,7 +188,7 @@ class PDFPageView extends BasePDFPageView {
this.maxCanvasPixels = this.maxCanvasPixels =
options.maxCanvasPixels ?? AppOptions.get("maxCanvasPixels"); options.maxCanvasPixels ?? AppOptions.get("maxCanvasPixels");
this.maxCanvasDim = options.maxCanvasDim || AppOptions.get("maxCanvasDim"); this.maxCanvasDim = options.maxCanvasDim || AppOptions.get("maxCanvasDim");
this.#enableAutoLinking = options.enableAutoLinking || false; this.#enableAutoLinking = options.enableAutoLinking !== false;
this.l10n = options.l10n; this.l10n = options.l10n;
if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) { if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) {

View file

@ -137,7 +137,7 @@ function isValidAnnotationEditorMode(mode) {
* @property {boolean} [supportsPinchToZoom] - Enable zooming on pinch gesture. * @property {boolean} [supportsPinchToZoom] - Enable zooming on pinch gesture.
* The default value is `true`. * The default value is `true`.
* @property {boolean} [enableAutoLinking] - Enable creation of hyperlinks from * @property {boolean} [enableAutoLinking] - Enable creation of hyperlinks from
* text that look like URLs. The default value is `false`. * text that look like URLs. The default value is `true`.
*/ */
class PDFPageViewBuffer { class PDFPageViewBuffer {
@ -238,7 +238,7 @@ class PDFViewer {
#enableNewAltTextWhenAddingImage = false; #enableNewAltTextWhenAddingImage = false;
#enableAutoLinking = false; #enableAutoLinking = true;
#eventAbortController = null; #eventAbortController = null;
@ -340,7 +340,7 @@ class PDFViewer {
this.#mlManager = options.mlManager || null; this.#mlManager = options.mlManager || null;
this.#enableHWA = options.enableHWA || false; this.#enableHWA = options.enableHWA || false;
this.#supportsPinchToZoom = options.supportsPinchToZoom !== false; this.#supportsPinchToZoom = options.supportsPinchToZoom !== false;
this.#enableAutoLinking = options.enableAutoLinking || false; this.#enableAutoLinking = options.enableAutoLinking !== false;
this.defaultRenderingQueue = !options.renderingQueue; this.defaultRenderingQueue = !options.renderingQueue;
if ( if (