Wrap host selection copy in a try-catch (#1470)

This commit is contained in:
toasted-nutbread 2021-02-28 16:51:48 -05:00 committed by GitHub
parent 8f057c63fe
commit c192b4a4c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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':