mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2026-04-05 17:33:49 +00:00
Check for BroadcastChannel availability before instantiating it
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
class BrowserTabsConnector {
|
||||
constructor() {
|
||||
if (!('BroadcastChannel' in window)) return;
|
||||
|
||||
this.bc = new BroadcastChannel('pairdrop');
|
||||
this.bc.addEventListener('message', e => this._onMessage(e));
|
||||
Events.on('broadcast-send', e => this._broadcastSend(e.detail));
|
||||
|
||||
Reference in New Issue
Block a user