-
Notifications
You must be signed in to change notification settings - Fork 2
/
app.html
27 lines (27 loc) · 2.27 KB
/
app.html
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
<!DOCTYPE html>
<html {{ HTML_ATTRS }}>
<head>
{{ HEAD }}
<script type="text/javascript">
/**
* add sniff.js@1.3 @ausir 2017/3/26
* sniff.js is from http://www.alessandroferrini.it/lab/sniff/
* and check outdate browser then kick to outdatebrowser.html
*/
function sniff(){this.version="1.3",this.browserType,this.browserVersion,this.mobile,this.browserVersionExtended=null;for(var e,i=!1,s=navigator.userAgent.match(/Android/i)||navigator.userAgent.match(/BlackBerry/i)||navigator.userAgent.match(/iPhone|iPad|iPod/i)||navigator.userAgent.match(/Opera Mini/i)||navigator.userAgent.match(/IEMobile/i)||null,o=navigator.appName,n=navigator.userAgent,t=n.match(/(opera|chrome|safari|firefox|msie|trident|edge)\/?\s*(\.?\d+(\.\d+)*)/i),r=n.match(/(opera|chrome|safari|firefox|msie|trident|edge)\/?\s*(\.?\d+(\.\d+)*)/gi),a=0;a<r.length;a++)if(r[a].toLowerCase().indexOf("edge")>=0){var d=r[a].split("/"),m=d[0].toLowerCase(),f=d[1];i=!0,console.log("so qui")}if(!i){t&&null!=(e=n.match(/version\/([\.\d]+)/i))&&(t[2]=e[1]),t=t?[t[1],t[2]]:[o,navigator.appVersion,"-?"];var m=t[0].toLowerCase(),f=t[1];if("trident"==t[0].toLowerCase()){m="msie",console.log(n),f=n.match(/(rv)\:?(\.?\d+(\.\d+)*)/i);for(var l=0;l<f.length;l++)if(!isNaN(parseInt(f[l]))){f=f[l];break}}}this.mobile=s,this.browserType=m,this.browserVersion=parseInt(f),this.browserVersionExtended=f}var sniff=new sniff;"undefined"!=typeof document.documentElement.classList?(document.documentElement.classList.add(sniff.browserType),document.documentElement.classList.add("v"+sniff.browserVersion),null!=sniff.mobile&&document.documentElement.classList.add(sniff.mobile.toString().toLowerCase())):(document.documentElement.className+=" "+sniff.browserType+" v"+sniff.browserVersion,null!=sniff.mobile&&(document.documentElement.className+=" "+sniff.mobile.toString().toLowerCase()));
switch (window.sniff.browserType) {
case 'msie':
if( window.sniff.browserVersion < 10 ) window.location.href="outdatebroswer.html" ;
break;
case 'safari':
if( window.sniff.browserVersion < 7 ) window.location.href="outdatebroswer.html" ;
break;
default :
break;
}
</script>
</head>
<body {{ BODY_ATTRS }}>
{{ APP }}
</body>
</html>