1
0
mirror of https://github.com/nolanlawson/pinafore synced 2024-12-12 02:07:26 +01:00
Pinafore-Web-Client-Frontend/bin/browser-shim.js
Nolan Lawson 70da9a92a6
fix: close/open websocket on freeze/resume events (#1195)
* fix: close/open websocket on freeze/resume events

attempt to address #14

* fix unit tests
2019-05-08 19:58:32 -07:00

10 lines
262 B
JavaScript

// browser shims that run in node, so that page-lifecycle won't error
global.self = global
global.document = {
visibilityState: 'visible',
hasFocus: () => true,
wasDiscarded: false
}
global.addEventListener = () => {}
global.removeEventListener = () => {}