mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 01:36:22 +00:00
28 lines
492 B
JavaScript
28 lines
492 B
JavaScript
import browserEnv from 'browser-env'
|
|
browserEnv(['window', 'document', 'navigator'])
|
|
|
|
// for CodeMirror mockup
|
|
document.body.createTextRange = function() {
|
|
return {
|
|
setEnd: function() {},
|
|
setStart: function() {},
|
|
getBoundingClientRect: function() {
|
|
return { right: 0 }
|
|
},
|
|
getClientRects: function() {
|
|
return {
|
|
length: 0,
|
|
left: 0,
|
|
right: 0
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
window.localStorage = {
|
|
// polyfill
|
|
getItem() {
|
|
return '{}'
|
|
}
|
|
}
|