diff --git a/index.js b/index.js old mode 100644 new mode 100755 index 3cd5a38..4f364b7 --- a/index.js +++ b/index.js @@ -20,6 +20,13 @@ function copy(text, options) { mark.textContent = text; // used to conserve newline, etc mark.style.whiteSpace = 'pre'; + + // prevents scrolling to the end of the page + mark.style.position = 'fixed'; + mark.style.height = 0; + mark.style.width = 0; + mark.style.overflow = 'hidden'; + document.body.appendChild(mark); range.selectNode(mark);