summaryrefslogtreecommitdiff
path: root/ext/fg/js/gecko.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/fg/js/gecko.js')
-rw-r--r--ext/fg/js/gecko.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/ext/fg/js/gecko.js b/ext/fg/js/gecko.js
new file mode 100644
index 00000000..21671749
--- /dev/null
+++ b/ext/fg/js/gecko.js
@@ -0,0 +1,12 @@
+if (!document.caretRangeFromPoint){
+ document.caretRangeFromPoint = function polyfillcaretRangeFromPoint(x,y){
+ let range = document.createRange();
+ let position = document.caretPositionFromPoint(x,y);
+ if (!position) {
+ return null;
+ }
+ range.setStart(position.offsetNode, position.offset);
+ range.setEnd(position.offsetNode, position.offset);
+ return range;
+ };
+}