From c192b4a4c1b99be67d7503f084ff5f165e965735 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sun, 28 Feb 2021 16:51:48 -0500 Subject: Wrap host selection copy in a try-catch (#1470) --- ext/js/display/display.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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': -- cgit v1.2.3