forked from baron/baron-sso
[WIP]모바일 로그인창 테스트 강화중
This commit is contained in:
@@ -122,7 +122,7 @@
|
||||
</main>
|
||||
<script>
|
||||
var baronBootstrapStartedAt = performance.now();
|
||||
var baronMinimumShellMs = 1100;
|
||||
var baronMinimumShellMs = 0;
|
||||
window.addEventListener("flutter-first-frame", function () {
|
||||
var elapsedMs = performance.now() - baronBootstrapStartedAt;
|
||||
window.setTimeout(
|
||||
@@ -136,6 +136,63 @@
|
||||
);
|
||||
});
|
||||
</script>
|
||||
<script src="flutter_bootstrap.js" async></script>
|
||||
<script>
|
||||
(function () {
|
||||
function loadFlutter() {
|
||||
var script = document.createElement("script");
|
||||
script.src = "flutter_bootstrap.js";
|
||||
script.async = true;
|
||||
document.body.appendChild(script);
|
||||
}
|
||||
|
||||
var hostname = window.location.hostname;
|
||||
var isLocalhost =
|
||||
hostname === "localhost" || hostname === "127.0.0.1" || hostname === "::1";
|
||||
if (!isLocalhost || !("serviceWorker" in navigator)) {
|
||||
loadFlutter();
|
||||
return;
|
||||
}
|
||||
|
||||
navigator.serviceWorker
|
||||
.getRegistrations()
|
||||
.then(function (registrations) {
|
||||
return Promise.all(
|
||||
registrations.map(function (registration) {
|
||||
return registration.unregister();
|
||||
}),
|
||||
);
|
||||
})
|
||||
.then(function () {
|
||||
if (!window.caches) {
|
||||
return;
|
||||
}
|
||||
return caches.keys().then(function (keys) {
|
||||
return Promise.all(
|
||||
keys
|
||||
.filter(function (key) {
|
||||
return (
|
||||
key.indexOf("baron-userfront-") === 0 ||
|
||||
key.indexOf("flutter-app-cache") === 0
|
||||
);
|
||||
})
|
||||
.map(function (key) {
|
||||
return caches.delete(key);
|
||||
}),
|
||||
);
|
||||
});
|
||||
})
|
||||
.then(function () {
|
||||
if (navigator.serviceWorker.controller) {
|
||||
window.location.reload();
|
||||
return;
|
||||
}
|
||||
loadFlutter();
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.warn("[baron] failed to clear local service worker", error);
|
||||
loadFlutter();
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user