const head = document.getElementsByTagName('head')[0];
const ua = navigator.userAgent.toLowerCase();
const isMobile = /mobile|iphone|ipad|android/.test(ua);

if (isMobile) {
  mountMobile();
} else {
  mountDesktop();
}

function mountDesktop() {
  const style = document.createElement('link');
  style.setAttribute('href', '/_/resources/desktop/style.css');
  style.setAttribute('rel', 'stylesheet');
  head.appendChild(style);

  const script = document.createElement('script');
  script.setAttribute('src', '/_/resources/desktop/script.js');
  script.setAttribute('async', 'true');
  script.setAttribute('defer', 'true');
  head.appendChild(script);
}

function mountMobile() {
  const meta = document.createElement('meta');
  meta.setAttribute('name', 'viewport');
  meta.setAttribute('content', 'width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no');
  head.appendChild(meta);

  const style = document.createElement('link');
  style.setAttribute('href', '/_/resources/mobile/style.css');
  style.setAttribute('rel', 'stylesheet');
  head.appendChild(style);

  const script = document.createElement('script');
  script.setAttribute('src', '/_/resources/mobile/script.js');
  script.setAttribute('async', 'true');
  script.setAttribute('defer', 'true');
  head.appendChild(script);
}

@@ -167,18 +167,17 @@
 bile) %7B%0A
-  
+%09
 mountMob
@@ -192,18 +192,17 @@
  else %7B%0A
-  
+%09
 mountDes
@@ -234,26 +234,25 @@
 Desktop() %7B%0A
-  
+%09
 const style 
@@ -277,34 +277,33 @@
 lement('link');%0A
-  
+%09
 style.setAttribu
@@ -340,34 +340,33 @@
 op/style.css');%0A
-  
+%09
 style.setAttribu
@@ -382,34 +382,33 @@
  'stylesheet');%0A
-  
+%09
 head.appendChild
@@ -409,34 +409,33 @@
 dChild(style);%0A%0A
-  
+%09
 const script = d
@@ -459,34 +459,33 @@
 ment('script');%0A
-  
+%09
 script.setAttrib
@@ -522,34 +522,33 @@
 op/script.js');%0A
-  
+%09
 script.setAttrib
@@ -561,34 +561,33 @@
 sync', 'true');%0A
-  
+%09
 script.setAttrib
@@ -600,34 +600,33 @@
 efer', 'true');%0A
-  
+%09
 head.appendChild
@@ -663,18 +663,17 @@
 ile() %7B%0A
-  
+%09
 const me
@@ -705,26 +705,25 @@
 nt('meta');%0A
-  
+%09
 meta.setAttr
@@ -749,18 +749,17 @@
 port');%0A
-  
+%09
 meta.set
@@ -867,26 +867,25 @@
 lable=no');%0A
-  
+%09
 head.appendC
@@ -893,26 +893,25 @@
 ild(meta);%0A%0A
-  
+%09
 const style 
@@ -940,26 +940,25 @@
 nt('link');%0A
-  
+%09
 style.setAtt
@@ -1006,18 +1006,17 @@
 .css');%0A
-  
+%09
 style.se
@@ -1044,26 +1044,25 @@
 ylesheet');%0A
-  
+%09
 head.appendC
@@ -1075,18 +1075,17 @@
 tyle);%0A%0A
-  
+%09
 const sc
@@ -1121,26 +1121,25 @@
 ('script');%0A
-  
+%09
 script.setAt
@@ -1183,26 +1183,25 @@
 cript.js');%0A
-  
+%09
 script.setAt
@@ -1226,18 +1226,17 @@
 true');%0A
-  
+%09
 script.s
@@ -1269,10 +1269,9 @@
 ');%0A
-  
+%09
 head

Use tab for indentation