diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2021-02-28 16:51:48 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-28 16:51:48 -0500 |
commit | c192b4a4c1b99be67d7503f084ff5f165e965735 (patch) | |
tree | e396b61edf21c0252e6467b7bda3ba098a6d14b7 /ext/js | |
parent | 8f057c63fea6f06e921f2134d881192002dd23bc (diff) |
Wrap host selection copy in a try-catch (#1470)
Diffstat (limited to 'ext/js')
-rw-r--r-- | ext/js/display/display.js | 10 |
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': |