Check for BroadcastChannel availability before instantiating it
This commit is contained in:
		
							parent
							
								
									659b53b5fa
								
							
						
					
					
						commit
						44c0f3dbaa
					
				|  | @ -1,5 +1,7 @@ | ||||||
| class BrowserTabsConnector { | class BrowserTabsConnector { | ||||||
|     constructor() { |     constructor() { | ||||||
|  |         if (!('BroadcastChannel' in window)) return; | ||||||
|  | 
 | ||||||
|         this.bc = new BroadcastChannel('pairdrop'); |         this.bc = new BroadcastChannel('pairdrop'); | ||||||
|         this.bc.addEventListener('message', e => this._onMessage(e)); |         this.bc.addEventListener('message', e => this._onMessage(e)); | ||||||
|         Events.on('broadcast-send', e => this._broadcastSend(e.detail)); |         Events.on('broadcast-send', e => this._broadcastSend(e.detail)); | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	 schlagmichdoch
						schlagmichdoch