-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.js
66 lines (59 loc) · 3.16 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
var OSName="Unknown OS";
if (navigator.userAgent.indexOf("Mozilla/5.0 (Mobile; rv")!=-1) OSName="Firefox OS";
if (navigator.userAgent.indexOf("Mozilla/5.0 (Mobile; rv:48.0")!=-1) OSName="KaiOS";
if (navigator.userAgent.indexOf("KAIOS")!=-1) OSName="KaiOS";
// start of "window.onload"
window.onload = function(){
document.querySelector("#splashloader").innerHTML = ``;
var envlogtxt = "Environment detected: "
if(OSName == 'Firefox OS'){
console.log(envlogtxt +OSName +"🦊");
var environmenttext = document.getElementById('environment');
var text = document.createTextNode(OSName);
environmenttext.appendChild(text);
}
if(OSName == 'KaiOS'){
console.log(envlogtxt +OSName +"🈺");
var environmenttext = document.getElementById('environment');
var text = document.createTextNode(OSName);
environmenttext.appendChild(text);
//document.querySelector("#head").innerHTML += `<script type="text/javascript" src="platform-kaios.js"></script>`;
//document.getElementsByTagName('head')[0].appendChild = '<script type="text/javascript" src="platform-kaios.js"></script>'
//document.querySelector("#head").writeln = `<script type="text/javascript" src="platform-kaios.js"></script>`;
requirejs(["platform-kaios.js"], function(util) {
//This function is called when scripts/helper/util.js is loaded.
//If util.js calls define(), then this function is not fired until
//util's dependencies have loaded, and the util argument will hold
//the module value for "helper/util".
});
requirejs(["platform-kaios-custom.js"], function(util) {
//This function is called when scripts/helper/util.js is loaded.
//If util.js calls define(), then this function is not fired until
//util's dependencies have loaded, and the util argument will hold
//the module value for "helper/util".
});
}
//if ((OSName !== 'Firefox OS') || (OSName !== 'KaiOS')){
// console.log("Environment detected: Not Firefox OS and not KaiOS.");
// var environmenttext = document.getElementById('environment');
// var text = document.createTextNode("Not Firefox OS and not KaiOS.");
// environmenttext.appendChild(text);
//}
if (OSName !== 'KaiOS'){
requirejs(["platform-not-kaios.js"],function(util){});
requirejs(["platform-not-kaios-custom.js"],function(util){});
if (OSName !== 'Firefox OS'){
document.querySelector("#splashloader").innerHTML = ``;
console.log(envlogtxt +"Not Firefox OS and not KaiOS.");
var environmenttext = document.getElementById('environment');
var text = document.createTextNode("Not Firefox OS and not KaiOS.");
environmenttext.appendChild(text);
requirejs(["platform-not-kaios-not-firefox.js"], function(util) {
//This function is called when scripts/helper/util.js is loaded.
//If util.js calls define(), then this function is not fired until
//util's dependencies have loaded, and the util argument will hold
//the module value for "helper/util".
});
}
}
} // end of "window.onload"