mirror of
https://github.com/nextcloud/all-in-one.git
synced 2024-12-31 02:52:19 +08:00
3ac260837f
Signed-off-by: szaimen <szaimen@e.mail.de>
12 lines
No EOL
443 B
JavaScript
12 lines
No EOL
443 B
JavaScript
const channel = new BroadcastChannel('tab')
|
|
|
|
channel.postMessage('second-tab')
|
|
// note that listener is added after posting the message
|
|
|
|
channel.addEventListener('message', (msg) => {
|
|
if (msg.data === 'second-tab') {
|
|
// message received from 2nd tab
|
|
document.getElementById('overlay').classList.add('loading')
|
|
alert('Cannot open multiple instances. You can use AIO here by reloading the page.')
|
|
}
|
|
}); |