Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, viewport-fit=cover">
<script>
setInterval(
function() {
// this value will not be correct until you rotate your screen to landscape and back to portrait
document.write("window.height === " + window.innerHeight + "<br />")
},
patch ({state, getters, commit, dispatch}, doc) {
const store = this
let response
// check that the payload exists
if (doc) {
const id = (getters.collectionMode) ? getId(doc) : getters.docModeId,
value = (getters.collectionMode) ? getValueFromPayloadPiece(doc) : doc
@louisameline
louisameline / windowMouseOutFix.js
Last active July 21, 2023 13:42
Electron: workaround for issue #611
/**
* Work around for https://github.com/electron/electron/issues/611
* This snippet will check if the cursor has left the window, and trigger
* mouse events accordingly. It even works with -webkit-app-region areas,
* which usually don't send any mouse events, so it's pretty cool. You
* can see the result in this gif: http://s214903023.onlinehome.fr/divers/fix.gif
* Help is welcome for improvement, for example to remove the dependency to
* jQuery.
*
* Caveats:it triggers too many events. For example when the mouse