This commit is contained in:
cutls 2020-02-08 00:52:23 +09:00
parent 8d812fbd2c
commit 47d69857ba
2 changed files with 19 additions and 13 deletions

View File

@ -190,3 +190,22 @@ onmessage = function(e) {
}) })
} }
} }
/* PWA */
if(pwa) {
function postMessage(e) {
if (e[0] == 'openUrl') {
urls = e[1].match(/https?:\/\/(.+)/)
if (urls) {
Swal.fire({
title: 'Open URL',
icon: 'info',
html:
`If you are OK, click: <a href="${urls[0]}" target="_blank" class="btn waves-effect">Here</a>`,
showCloseButton: false,
showCancelButton: true,
focusConfirm: false,
})
}
}
}
}

View File

@ -283,16 +283,3 @@ function statusModel(now) {
poll: null poll: null
} }
} }
/* PWA */
if(pwa) {
function postMessage(e) {
if (e[0] == 'openUrl') {
urls = e[1].match(/https?:\/\/(.+)/)
if (urls) {
if(confirm("Open: " + urls)) {
window.open(urls)
}
}
}
}
}