Skip to content

Commit 41865d7

Browse files
committed
Add the possibility to enable/disable the eraser in the pref.
1 parent 3cc005b commit 41865d7

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

extensions/chromium/preferences_schema.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,11 @@
239239
"type": "boolean",
240240
"default": false
241241
},
242+
"enableEraser": {
243+
"description": "Enable the eraser to erase annotations like Ink.",
244+
"type": "boolean",
245+
"default": false
246+
},
242247
"enableOptimizedPartialRendering": {
243248
"description": "Enable tracking of PDF operations to optimize partial rendering.",
244249
"type": "boolean",

web/app.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,10 @@ const PDFViewerApplication = {
649649
}
650650
}
651651

652+
if (!AppOptions.get("enableEraser")) {
653+
appConfig.toolbar?.editorEraserButton?.parentElement.remove();
654+
}
655+
652656
if (appConfig.secondaryToolbar) {
653657
if (AppOptions.get("enableAltText")) {
654658
appConfig.secondaryToolbar.imageAltTextSettingsButton?.classList.remove(

web/app_options.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,11 @@ const defaultOptions = {
228228
value: true,
229229
kind: OptionKind.VIEWER,
230230
},
231+
enableEraser: {
232+
/** @type {boolean} */
233+
value: typeof PDFJSDev === "undefined" || PDFJSDev.test("TESTING"),
234+
kind: OptionKind.VIEWER + OptionKind.PREFERENCE,
235+
},
231236
enableGuessAltText: {
232237
/** @type {boolean} */
233238
value: true,

0 commit comments

Comments
 (0)