diff --git a/lib/rangy-core.js b/lib/rangy-core.js index dafb1ce1..c92a4887 100644 --- a/lib/rangy-core.js +++ b/lib/rangy-core.js @@ -2963,13 +2963,19 @@ if (chromeMatch && parseInt(chromeMatch[1]) >= 36) { selectionSupportsMultipleRanges = false; } else { - var r2 = r1.cloneRange(); - r1.setStart(textNode, 0); - r2.setEnd(textNode, 3); - r2.setStart(textNode, 2); - sel.addRange(r1); - sel.addRange(r2); - selectionSupportsMultipleRanges = (sel.rangeCount == 2); + var r2; + try { + // code generating above exception + r2 = r1.cloneRange(); + r1.setStart(textNode, 0); + r2.setEnd(textNode, 3); + r2.setStart(textNode, 2); + sel.addRange(r1); + sel.addRange(r2); + selectionSupportsMultipleRanges = (sel.rangeCount == 2); + } catch (e) { + selectionSupportsMultipleRanges = false; + } } } @@ -3842,4 +3848,4 @@ } return api; -}, this); \ No newline at end of file +}, this); diff --git a/package.json b/package.json index 91c2daef..8545cff1 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "rangy", "description": "A cross-browser DOM range and selection library", - "version": "1.3.1-dev", + "version": "1.3.2", "author": { "name": "Tim Down", "email": "tim@timdown.co.uk", @@ -28,4 +28,4 @@ }, "dependencies": {}, "devDependencies": {} -} \ No newline at end of file +}