This commit is contained in:
syuilo 2018-03-15 12:56:50 +09:00
parent 2588e7ae9e
commit 45cb5cec04
5 changed files with 34 additions and 13 deletions

View file

@ -62,13 +62,17 @@
app = isMobile ? 'mobile' : 'desktop';
}
// Script version
const ver = localStorage.getItem('v') || VERSION;
// Whether use raw version script
const raw = localStorage.getItem('useRawScript') == 'true';
// 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}.js`);
script.setAttribute('src', `/assets/${app}.${ver}.${lang}.${raw ? 'raw' : 'min'}.js`);
script.setAttribute('async', 'true');
script.setAttribute('defer', 'true');
head.appendChild(script);