From: Dylan Hardison Date: Tue, 19 Jul 2016 21:49:01 +0000 (-0400) Subject: Bug 1275595 - document.execCommand('cut'/'copy') was denied because it was not called... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3105082f7df647cca14062eef340d4158574b163;p=thirdparty%2Fbugzilla.git Bug 1275595 - document.execCommand('cut'/'copy') was denied because it was not called from inside a short running user-generated event handler. --- diff --git a/extensions/BugModal/web/bug_modal.js b/extensions/BugModal/web/bug_modal.js index e7a182580..dfbe06bad 100644 --- a/extensions/BugModal/web/bug_modal.js +++ b/extensions/BugModal/web/bug_modal.js @@ -255,14 +255,9 @@ $(function() { } if ($('#copy-summary').length) { - - // probe for document.execCommand("copy") support var hasExecCopy = false; try { - // on page load nothing will be selected, so we don't smash the - // clipboard doing this - document.execCommand("copy"); - hasExecCopy = true; + hasExecCopy = document.queryCommandSupported("copy"); } catch(ex) { // ignore }