adding more polyfill goodness for firefox
This commit is contained in:
parent
491480c409
commit
944be5fa64
@ -1,5 +1,3 @@
|
|||||||
console.log('blah');
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Gecko does not currently support chrome.storage.sync, use storage.local instead
|
// Gecko does not currently support chrome.storage.sync, use storage.local instead
|
||||||
// https://bugzilla.mozilla.org/show_bug.cgi?id=1220494
|
// https://bugzilla.mozilla.org/show_bug.cgi?id=1220494
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
<div class="content"></div>
|
<div class="content"></div>
|
||||||
|
|
||||||
<script src="../lib/jquery-2.2.2.min.js"></script>
|
<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/util.js"></script>
|
||||||
<script src="js/frame.js"></script>
|
<script src="js/frame.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
12
ext/fg/js/gecko.js
Normal file
12
ext/fg/js/gecko.js
Normal file
@ -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;
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user