From 47d69857ba90aeed15a9f1406951d5fed8e44f42 Mon Sep 17 00:00:00 2001 From: cutls Date: Sat, 8 Feb 2020 00:52:23 +0900 Subject: [PATCH] pwa: fix --- app/js/platform/end.js | 19 +++++++++++++++++++ app/js/platform/first.js | 13 ------------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/app/js/platform/end.js b/app/js/platform/end.js index 7a64922e..f518cc98 100644 --- a/app/js/platform/end.js +++ b/app/js/platform/end.js @@ -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: Here`, + showCloseButton: false, + showCancelButton: true, + focusConfirm: false, + }) + } + } + } +} \ No newline at end of file diff --git a/app/js/platform/first.js b/app/js/platform/first.js index 4f052d9e..d309c3d4 100644 --- a/app/js/platform/first.js +++ b/app/js/platform/first.js @@ -283,16 +283,3 @@ function statusModel(now) { 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) - } - } - } - } -} \ No newline at end of file