summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2018-12-10 17:09:06 -0500
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2018-12-10 17:09:06 -0500
commit33ec369eff87ace3e8b49c6461fa1b9a5d2a1202 (patch)
tree6f723635c07077c171b3d80913609af48b94f4db /ext
parent39cf302eefe1b3bc19e4a91c222872b322426354 (diff)
Catch exceptions thrown by range.getClientRects()
Firefox dev 65 was throwing an exception
Diffstat (limited to 'ext')
-rw-r--r--ext/fg/js/document.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/ext/fg/js/document.js b/ext/fg/js/document.js
index 9366832e..73e89d99 100644
--- a/ext/fg/js/document.js
+++ b/ext/fg/js/document.js
@@ -92,7 +92,19 @@ function docRangeFromPoint(point) {
if(imposter !== null) imposter.style.zIndex = -2147483646;
- const rect = range.getClientRects()[0];
+ let rects;
+ try {
+ rects = range.getClientRects();
+ }
+ catch (e) {
+ return;
+ }
+
+ if (rects.length === 0) {
+ return;
+ }
+
+ const rect = rects[0];
if (point.y > rect.bottom + 2) {
return;
}