I want to use broadcastchannel for the supported browsers for unsupported ones like safai, i use the else code
I want to check whether the BroadcastChannel is supported or not and accordingly ride the code to else part
if(BroadcastChannel) {
new BroadcastChannel('oauthComplete').postMessage({
email: 'mail@gmail.com',
serviceName: '4sdbhfg@mx.co.us.user'
});
}
else
alert("Please close this tab and reopen");
How do I check whether BroadcastChannel is supported or not?