mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-03-24 13:03:39 +00:00
nanka iroiro
This commit is contained in:
@@ -1,18 +1,29 @@
|
||||
/**
|
||||
* MISSKEY ENTRY POINT
|
||||
*/
|
||||
(() => {
|
||||
const head = document.getElementsByTagName('head')[0];
|
||||
|
||||
// Detect user agent
|
||||
const ua = navigator.userAgent.toLowerCase();
|
||||
const isMobile = /mobile|iphone|ipad|android/.test(ua);
|
||||
|
||||
isMobile ? mountMobile() : mountDesktop();
|
||||
|
||||
/**
|
||||
* Mount the desktop app
|
||||
*/
|
||||
function mountDesktop() {
|
||||
const script = document.createElement('script');
|
||||
script.setAttribute('src', '/resources/desktop/script.js');
|
||||
script.setAttribute('src', `/resources/desktop/script.${VERSION}.js`);
|
||||
script.setAttribute('async', 'true');
|
||||
script.setAttribute('defer', 'true');
|
||||
head.appendChild(script);
|
||||
}
|
||||
|
||||
/**
|
||||
* Mount the mobile app
|
||||
*/
|
||||
function mountMobile() {
|
||||
const meta = document.createElement('meta');
|
||||
meta.setAttribute('name', 'viewport');
|
||||
@@ -20,7 +31,7 @@
|
||||
head.appendChild(meta);
|
||||
|
||||
const script = document.createElement('script');
|
||||
script.setAttribute('src', '/resources/mobile/script.js');
|
||||
script.setAttribute('src', `/resources/mobile/script.${VERSION}.js`);
|
||||
script.setAttribute('async', 'true');
|
||||
script.setAttribute('defer', 'true');
|
||||
head.appendChild(script);
|
||||
|
||||
Reference in New Issue
Block a user