Skip to content

[api-minor] Enable enableAutoLinking by default #19701

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion extensions/chromium/preferences_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
"enableAutoLinking": {
"description": "Enable creation of hyperlinks from text that look like URLs.",
"type": "boolean",
"default": false
"default": true
}
}
}
2 changes: 1 addition & 1 deletion web/app_options.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ const defaultOptions = {
},
enableAutoLinking: {
/** @type {boolean} */
value: typeof PDFJSDev === "undefined" || PDFJSDev.test("MOZCENTRAL"),
value: true,
kind: OptionKind.VIEWER + OptionKind.PREFERENCE,
},
enableDetailCanvas: {
Expand Down
6 changes: 3 additions & 3 deletions web/pdf_page_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ import { XfaLayerBuilder } from "./xfa_layer_builder.js";
* @property {boolean} [enableHWA] - Enables hardware acceleration for
* rendering. The default value is `false`.
* @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 =
Expand Down Expand Up @@ -130,7 +130,7 @@ class PDFPageView extends BasePDFPageView {

#canvasWrapper = null;

#enableAutoLinking = false;
#enableAutoLinking = true;

#hasRestrictedScaling = false;

Expand Down Expand Up @@ -188,7 +188,7 @@ class PDFPageView extends BasePDFPageView {
this.maxCanvasPixels =
options.maxCanvasPixels ?? AppOptions.get("maxCanvasPixels");
this.maxCanvasDim = options.maxCanvasDim || AppOptions.get("maxCanvasDim");
this.#enableAutoLinking = options.enableAutoLinking || false;
this.#enableAutoLinking = options.enableAutoLinking !== false;

this.l10n = options.l10n;
if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) {
Expand Down
6 changes: 3 additions & 3 deletions web/pdf_viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ function isValidAnnotationEditorMode(mode) {
* @property {boolean} [supportsPinchToZoom] - Enable zooming on pinch gesture.
* The default value is `true`.
* @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 {
Expand Down Expand Up @@ -238,7 +238,7 @@ class PDFViewer {

#enableNewAltTextWhenAddingImage = false;

#enableAutoLinking = false;
#enableAutoLinking = true;

#eventAbortController = null;

Expand Down Expand Up @@ -340,7 +340,7 @@ class PDFViewer {
this.#mlManager = options.mlManager || null;
this.#enableHWA = options.enableHWA || false;
this.#supportsPinchToZoom = options.supportsPinchToZoom !== false;
this.#enableAutoLinking = options.enableAutoLinking || false;
this.#enableAutoLinking = options.enableAutoLinking !== false;

this.defaultRenderingQueue = !options.renderingQueue;
if (
Expand Down