all repos — simplyrpg @ b1d5daf21334d3da94abd04cb734a157b3b13fbe

Fork of https://github.com/harperd1/simplyRPG — multi-map VTT, token visibility, dark theme, stream HUD

libraries/fakeBroadcastPolyfill.js (view raw)

 1//This is a fake polyfill for the broadcast channel functionality which is missing in Safari and internet explorer
 2//It doesn't actually solve anything, but it prevents the lack of broadcast channel from breaking the rest of the site in these browsers
 3
 4let supportsMirrorMap;
 5let scopeHolder;
 6if (typeof BroadcastChannel === 'undefined') {
 7    class BroadcastChannel {
 8        constructor (name ) {
 9            this.name = name;
10        }
11
12        postMessage( ){
13        }
14
15    }
16
17    scopeHolder = BroadcastChannel;
18    supportsMirrorMap = false;
19} else {
20    scopeHolder = BroadcastChannel;
21    supportsMirrorMap = true;
22}
23
24BroadcastChannel = scopeHolder