Skip to content

Commit

Permalink
Merge pull request #5 from utanapishtim/firefox-getSelection-null-fix
Browse files Browse the repository at this point in the history
add null check and fallback to document.getSelection to handle firefo…
  • Loading branch information
feross committed Apr 7, 2017
2 parents de32542 + 8c96ad5 commit c552f1b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ function clipboardCopy (text) {
win.document.body.appendChild(span)

var selection = win.getSelection()
if (selection === null) selection = document.getSelection()
var range = win.document.createRange()

var success = false
Expand Down

0 comments on commit c552f1b

Please sign in to comment.