summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-02-28 16:51:48 -0500
committerGitHub <noreply@github.com>2021-02-28 16:51:48 -0500
commitc192b4a4c1b99be67d7503f084ff5f165e965735 (patch)
treee396b61edf21c0252e6467b7bda3ba098a6d14b7 /ext
parent8f057c63fea6f06e921f2134d881192002dd23bc (diff)
Wrap host selection copy in a try-catch (#1470)
Diffstat (limited to 'ext')
-rw-r--r--ext/js/display/display.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/ext/js/display/display.js b/ext/js/display/display.js
index 3bb75011..a6f61dad 100644
--- a/ext/js/display/display.js
+++ b/ext/js/display/display.js
@@ -1625,10 +1625,18 @@ class Display extends EventDispatcher {
_copyHostSelection() {
if (this._contentOriginFrameId === null || window.getSelection().toString()) { return false; }
- this._copyHostSelectionInner();
+ this._copyHostSelectionSafe();
return true;
}
+ async _copyHostSelectionSafe() {
+ try {
+ await this._copyHostSelectionInner();
+ } catch (e) {
+ // NOP
+ }
+ }
+
async _copyHostSelectionInner() {
switch (this._browser) {
case 'firefox':