mirror of
https://github.com/webxoss/webxoss-client.git
synced 2024-11-20 05:49:55 +01:00
remove migration
This commit is contained in:
parent
67dc2e2d00
commit
81899bb794
2 changed files with 6 additions and 31 deletions
35
migrate.html
35
migrate.html
|
@ -1,39 +1,14 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html manifest="webxoss.appcache">
|
<html manifest="webxoss.appcache">
|
||||||
<head>
|
<head>
|
||||||
<title>Migrate WEBXOSS data</title>
|
<title>WEBXOSS</title>
|
||||||
|
<meta http-equiv="refresh" content="0; url=https://webxoss.com/" />
|
||||||
|
<link rel="canonical" href="https://webxoss.com/">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<iframe id="iframe" style="display: none;" src="about:blank"></iframe>
|
<p>Redirecting to <a href="https://webxoss.com/">https://webxoss.com/</a> ...</p>
|
||||||
<script>
|
<script>
|
||||||
(function () {
|
window.location.replace('https://webxoss.com/')
|
||||||
if (location.protocol === 'https:') {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// migrated by the old way, buggy in safari
|
|
||||||
if (localStorage.getItem('migrated') === 'true') {
|
|
||||||
if (!window.safari) {
|
|
||||||
return location.replace(location.href.replace(/^http:/, 'https:'))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// migrated by the new way
|
|
||||||
if (localStorage.getItem('migrated') === '2') {
|
|
||||||
return location.replace(location.href.replace(/^http:/, 'https:'))
|
|
||||||
}
|
|
||||||
function getStorage() {
|
|
||||||
var storage = {}
|
|
||||||
for (var i = 0; i < localStorage.length; i++) {
|
|
||||||
var key = localStorage.key(i)
|
|
||||||
storage[key] = localStorage.getItem(key)
|
|
||||||
}
|
|
||||||
return storage
|
|
||||||
}
|
|
||||||
var storage = getStorage()
|
|
||||||
localStorage.setItem('migrated', 2)
|
|
||||||
// pass localStorage via url hash, which is ignored in network request
|
|
||||||
var url = location.href.replace(/^http:/, 'https:') + '#storage=' + JSON.stringify(storage)
|
|
||||||
return location.replace(url)
|
|
||||||
})()
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
|
@ -47,4 +47,4 @@ background/loading.gif
|
||||||
NETWORK:
|
NETWORK:
|
||||||
*
|
*
|
||||||
|
|
||||||
# 2016/05/10 02:19
|
# 2016/05/11 10:42
|
||||||
|
|
Loading…
Reference in a new issue