aboutsummaryrefslogtreecommitdiff
path: root/ext/fg/js/gecko.js
blob: 216717498e600bcb860283c032fb91c47218794a (plain)
1
2
3
4
5
6
7
8
9
10
11
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;
    };
}