mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2025-04-21 07:16:18 -04:00
Check for BroadcastChannel availability before instantiating it
This commit is contained in:
parent
659b53b5fa
commit
44c0f3dbaa
1 changed files with 2 additions and 0 deletions
|
@ -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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue