summaryrefslogtreecommitdiff
path: root/ext/bg/js/search.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-12-18 11:24:43 -0500
committerGitHub <noreply@github.com>2020-12-18 11:24:43 -0500
commitc728448a4d05268d4febb9950a39d517a75ea052 (patch)
treefc6ef90de9732cf0b0ac35e1d76a1515c8294b4d /ext/bg/js/search.js
parentbf349050123eaaa7b58f82b7e3a84e2857fdea8c (diff)
Maximum clipboard search length (#1118)
* Add maximumClipboardSearchLength an option * Add setting * Add limits * Update tests
Diffstat (limited to 'ext/bg/js/search.js')
-rw-r--r--ext/bg/js/search.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/bg/js/search.js b/ext/bg/js/search.js
index d99e76e0..85efc7a0 100644
--- a/ext/bg/js/search.js
+++ b/ext/bg/js/search.js
@@ -197,6 +197,10 @@ class DisplaySearch extends Display {
}
_onExternalSearchUpdate({text, animate=true}) {
+ const {general: {maximumClipboardSearchLength}} = this.getOptions();
+ if (text.length > maximumClipboardSearchLength) {
+ text = text.substring(0, maximumClipboardSearchLength);
+ }
this._queryInput.value = text;
this._search(animate, false);
}