mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-19 22:16:49 +00:00
add 2nd tab warning
Signed-off-by: szaimen <szaimen@e.mail.de>
This commit is contained in:
parent
9d4c591f1a
commit
3ac260837f
2 changed files with 15 additions and 0 deletions
12
php/public/second-tab-warning.js
Normal file
12
php/public/second-tab-warning.js
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
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.')
|
||||
}
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue