From 8c96ad5e86acbaaf9e50a29a73f74f6149322419 Mon Sep 17 00:00:00 2001 From: Noah Cawley Date: Fri, 7 Apr 2017 11:19:05 -0700 Subject: [PATCH] add null check and fallback to document.getSelection to handle firefox 45.7.0 iframe.windowContent.getSelection() returning null --- index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/index.js b/index.js index 4d4c450..1009a44 100644 --- a/index.js +++ b/index.js @@ -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