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
| var browser = { versions: function () { var u = navigator.userAgent, app = navigator.appVersion; return { dingTalk: u.indexOf("DingTalk") > -1, weibo: u.indexOf("weibo") > -1, qq: u.indexOf("QQ/") > -1, qqBrowser: u.indexOf("MQQBrowser") > -1, weChat: u.indexOf("MicroMessenger") > -1, trident: u.indexOf("Trident") > -1, presto: u.indexOf("Presto") > -1, webKit: u.indexOf("AppleWebKit") > -1, gecko: u.indexOf("Gecko") > -1 && u.indexOf("KHTML") == -1, mobile: !!u.match(/AppleWebKit.*Mobile.*/) || !!u.match(/Windows Phone/) || !!u.match(/Android/) || !!u.match(/MQQBrowser/), ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), android: u.indexOf("Android") > -1 || u.indexOf("Linux") > -1, iPhone: u.indexOf("iPhone") > -1 || u.indexOf("Mac") > -1, iPad: u.indexOf("iPad") > -1, webApp: u.indexOf("Safari") == -1 }; }(), language: (navigator.browserLanguage || navigator.language).toLowerCase() }; function OpenApp() { if (!IsPC()) { if (browser.versions.weChat || browser.versions.qq || browser.versions.dingTalk || browser.versions.weibo) { ShowGuide(); if (browser.versions.ios) { ShowIosGuide(); } else { ShowAdrGuide(); } } else { if (navigator.onLine) { window.location.href = "fivekilometres://articleDetail?id=" + getURLParameter("articleId") + "&type=" + localStorage.getItem("contentType") + "&sharer=" + getURLParameter("sharer"); setTimeout(function () { setTimeout(function () { download(); }, 2000); }, 3000); } else { alert("请查看您的网络链接"); } } } else { download(); } }
|