summaryrefslogtreecommitdiff
path: root/ext/fg/js/frontend.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/fg/js/frontend.js')
-rw-r--r--ext/fg/js/frontend.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/ext/fg/js/frontend.js b/ext/fg/js/frontend.js
index 13b0d80c..95c9eb1b 100644
--- a/ext/fg/js/frontend.js
+++ b/ext/fg/js/frontend.js
@@ -320,6 +320,7 @@ class Frontend {
await this._updatePopup();
+ const preventMiddleMouse = this._getPreventMiddleMouseValueForPageType(scanningOptions.preventMiddleMouse);
this._textScanner.setOptions({
inputs: scanningOptions.inputs,
deepContentScan: scanningOptions.deepDomScan,
@@ -329,7 +330,8 @@ class Frontend {
pointerEventsEnabled: scanningOptions.pointerEventsEnabled,
scanLength: scanningOptions.length,
sentenceExtent: options.anki.sentenceExt,
- layoutAwareScan: scanningOptions.layoutAwareScan
+ layoutAwareScan: scanningOptions.layoutAwareScan,
+ preventMiddleMouse
});
this._updateTextScannerEnabled();
@@ -616,4 +618,13 @@ class Frontend {
await this._updatePendingOptions();
return await this.getOptionsContext();
}
+
+ _getPreventMiddleMouseValueForPageType(preventMiddleMouseOptions) {
+ switch (this._pageType) {
+ case 'web': return preventMiddleMouseOptions.onWebPages;
+ case 'popup': return preventMiddleMouseOptions.onPopupPages;
+ case 'search': return preventMiddleMouseOptions.onSearchPages;
+ default: return false;
+ }
+ }
}