diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-04-21 16:40:16 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-04-21 16:40:16 +0900 |
| commit | 86e1b792c20c47019d4d9ca51164d0e230101324 (patch) | |
| tree | db3a1e95ce8545e4748dd74d1d2bc9c464d7140c /src/client | |
| parent | Revert "wait" (diff) | |
| download | misskey-86e1b792c20c47019d4d9ca51164d0e230101324.tar.gz misskey-86e1b792c20c47019d4d9ca51164d0e230101324.tar.bz2 misskey-86e1b792c20c47019d4d9ca51164d0e230101324.zip | |
Salt
Diffstat (limited to 'src/client')
| -rw-r--r-- | src/client/app/boot.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/client/app/boot.js b/src/client/app/boot.js index 190ff255c3..8a79880fb4 100644 --- a/src/client/app/boot.js +++ b/src/client/app/boot.js @@ -78,11 +78,16 @@ const raw = (localStorage.getItem('useRawScript') == 'true' && isDebug) || ENV != 'production'; + // Get salt query + const salt = localStorage.getItem('salt') + ? '?salt=' + localStorage.getItem('salt') + : ''; + // Load an app script // Note: 'async' make it possible to load the script asyncly. // 'defer' make it possible to run the script when the dom loaded. const script = document.createElement('script'); - script.setAttribute('src', `/assets/${app}.${ver}.${lang}.${raw ? 'raw' : 'min'}.js`); + script.setAttribute('src', `/assets/${app}.${ver}.${lang}.${raw ? 'raw' : 'min'}.js${salt}`); script.setAttribute('async', 'true'); script.setAttribute('defer', 'true'); head.appendChild(script); @@ -118,6 +123,9 @@ function refresh() { localStorage.setItem('shouldFlush', 'false'); + // Random + localStorage.setItem('salt', Math.random().toString()); + // Clear cache (serive worker) try { navigator.serviceWorker.controller.postMessage('clear'); |