diff options
Diffstat (limited to 'ext/fg')
-rw-r--r-- | ext/fg/frame.html | 1 | ||||
-rw-r--r-- | ext/fg/js/gecko.js | 12 |
2 files changed, 13 insertions, 0 deletions
diff --git a/ext/fg/frame.html b/ext/fg/frame.html index 8246787b..b098a42d 100644 --- a/ext/fg/frame.html +++ b/ext/fg/frame.html @@ -13,6 +13,7 @@ <div class="content"></div> <script src="../lib/jquery-2.2.2.min.js"></script> + <script src="js/gecko.js"></script> <script src="js/util.js"></script> <script src="js/frame.js"></script> </body> 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; + }; +} |