分享

android自定义协议和html加载时自动尝试调用本地APP

 quasiceo 2014-09-09

通过iframe的方式试图打开本地APP,如果能正常打开,会直接切换到本地APP,并自动阻止a标签的默认行为
否则打开a标签的href链接
部分代码来自阿里巴巴的支付宝 m.alipay.com/appIndex.htm
xml代码
  1. <!--在AndroidManifest.xml中,定义Activity的Intent-filter-->
  2. <intent-filter>
  3. <action android:name="android.intent.action.VIEW" />
  4. <category android:name="android.intent.category.DEFAULT" />
  5. <category android:name="android.intent.category.BROWSABLE" />
  6. <data android:scheme="alipays" />
  7. </intent-filter>
  8. <!--VIEW,DEFAULT和BROWSABLE一个都不能少-->
  9. <!--最后的scheme是注册sf://这样的协议,当网页链接到这种协议的时候,就调用这个程序。-->
复制代码
复制代码Java代码
  1. protected void onCreate(Bundle savedInstanceState) {
  2. super.onCreate(savedInstanceState);
  3. final Intent intent = getIntent();
  4. final Uri uri = intent.getData();
  5. setTitle("自定义协议");
  6. textView.setText(uri.toString());
  7. }
复制代码
复制代码next
  1. 服务器响应部分
  2. HTTP/1.1 200 OK
  3. Date: Sat, 26 Apr 2014 16:49:19 GMT
  4. Server: Apache
  5. Set-Cookie: JSESSIONID=B3110F555F065616E9DE84526BC81D57; Path=/
  6. Strict-Transport-Security: max-age=31536000
  7. Set-Cookie: awid=mBDlK5rXYhf8K2OqfxFQa4YYUWehFkwap; Domain=.alipay.com; Path=/
  8. Content-Language: zh-CN
  9. Vary: Accept-Encoding,User-Agent
  10. Cache-Control: max-age=0,no-cache
  11. Expires: Thu, 05 Jan 1995 22:00:00 GMT
  12. Pragma: no-cache
  13. Keep-Alive: timeout=360, max=100
  14. Connection: Keep-Alive
  15. Transfer-Encoding: chunked
  16. Content-Type: text/html;charset=UTF-8
复制代码
复制代码
网页加载时自动切换到本地app
  1. <html>
  2. <head>
  3. <meta charset="UTF-8">
  4. <title>支付宝网站</title>
  5. <!-- CMS 无线监控埋点 开始 -->
  6. <!-- CMS:无线/无线wap全站通用/mtracker开始:wap/wap_common/mtracker.vm --><script>
  7. window._to = { start: new Date() };
  8. </script>
  9. <script>
  10. !function(a) {
  11. function b(a) {
  12. return Object.prototype.toString.call(a)
  13. }
  14. function c(a) {
  15. return "[object Object]" === b(a)
  16. }
  17. function d(a) {
  18. return "[object Function]" === b(a)
  19. }
  20. function e(a, b) {
  21. for (var c = 0,
  22. d = a.length; d > c && b.call(a, a[c], c) !== !1; c++);
  23. }
  24. function f(a) {
  25. if (!p.test(a)) return null;
  26. var b, c, d, e, f;
  27. if ( - 1 !== a.indexOf("trident/") && (b = /\btrident\/([0-9.]+)/.exec(a), b && b.length >= 2)) {
  28. d = b[1];
  29. var g = b[1].split(".");
  30. g[0] = parseInt(g[0], 10) + 4,
  31. f = g.join(".")
  32. }
  33. b = p.exec(a),
  34. e = b[1];
  35. var h = b[1].split(".");
  36. return "undefined" == typeof f && (f = e),
  37. h[0] = parseInt(h[0], 10) - 4,
  38. c = h.join("."),
  39. "undefined" == typeof d && (d = c),
  40. {
  41. browserVersion: f,
  42. browserMode: e,
  43. engineVersion: d,
  44. engineMode: c,
  45. compatible: d !== c
  46. }
  47. }
  48. function g(b) {
  49. if (o) try {
  50. var c = o.twGetRunPath.toLowerCase(),
  51. d = o.twGetSecurityID(a),
  52. e = o.twGetVersion(d);
  53. if (c && -1 === c.indexOf(b)) return ! 1;
  54. if (e) return {
  55. version: e
  56. }
  57. } catch(f) {}
  58. }
  59. function h(a, e, f) {
  60. var g = d(e) ? e.call(null, f) : e;
  61. if (!g) return null;
  62. var h = {
  63. name: a,
  64. version: k,
  65. codename: ""
  66. },
  67. i = b(g);
  68. if (g === !0) return h;
  69. if ("[object String]" === i) {
  70. if ( - 1 !== f.indexOf(g)) return h
  71. } else {
  72. if (c(g)) return g.hasOwnProperty("version") && (h.version = g.version),
  73. h;
  74. if (g.exec) {
  75. var j = g.exec(f);
  76. if (j) return h.version = j.length >= 2 && j[1] ? j[1].replace(/_/g, ".") : k,
  77. h
  78. }
  79. }
  80. }
  81. function i(a, b, c, d) {
  82. var f = u;
  83. e(b,
  84. function(b) {
  85. var c = h(b[0], b[1], a);
  86. return c ? (f = c, !1) : void 0
  87. }),
  88. c.call(d, f.name, f.version)
  89. }
  90. var j = {},
  91. k = "-1",
  92. l = navigator.userAgent || "",
  93. m = navigator.appVersion || "",
  94. n = navigator.vendor || "",
  95. o = a.external,
  96. p = /\b(?:msie |ie |trident\/[0-9].*rv[ :])([0-9.]+)/,
  97. q = [["nokia",
  98. function(a) {
  99. return - 1 !== a.indexOf("nokia ") ? /\bnokia ([0-9]+)?/: -1 !== a.indexOf("noain") ? /\bnoain ([a-z0-9]+)/: /\bnokia([a-z0-9]+)?/
  100. }], ["samsung",
  101. function(a) {
  102. return - 1 !== a.indexOf("samsung") ? /\bsamsung(?:\-gt)?[ \-]([a-z0-9\-]+)/: /\b(?:gt|sch)[ \-]([a-z0-9\-]+)/
  103. }], ["wp",
  104. function(a) {
  105. return - 1 !== a.indexOf("windows phone ") || -1 !== a.indexOf("xblwp") || -1 !== a.indexOf("zunewp") || -1 !== a.indexOf("windows ce")
  106. }], ["pc", "windows"], ["ipad", "ipad"], ["ipod", "ipod"], ["iphone", /\biphone\b|\biph(\d)/], ["mac", "macintosh"], ["mi", /\bmi[ \-]?([a-z0-9 ]+(?= build))/], ["aliyun", /\baliyunos\b(?:[\-](\d+))?/], ["meizu", /\b(?:meizu\/|m)([0-9]+)\b/], ["nexus", /\bnexus ([0-9s.]+)/], ["huawei",
  107. function(a) {
  108. return - 1 !== a.indexOf("huawei-huawei") ? /\bhuawei\-huawei\-([a-z0-9\-]+)/: /\bhuawei[ _\-]?([a-z0-9]+)/
  109. }], ["lenovo",
  110. function(a) {
  111. return - 1 !== a.indexOf("lenovo-lenovo") ? /\blenovo\-lenovo[ \-]([a-z0-9]+)/: /\blenovo[ \-]?([a-z0-9]+)/
  112. }], ["zte",
  113. function(a) {
  114. return /\bzte\-[tu]/.test(a) ? /\bzte-[tu][ _\-]?([a-su-z0-9\+]+)/: /\bzte[ _\-]?([a-su-z0-9\+]+)/
  115. }], ["vivo", /\bvivo ([a-z0-9]+)/], ["htc",
  116. function(a) {
  117. return /\bhtc[a-z0-9 _\-]+(?= build\b)/.test(a) ? /\bhtc[ _\-]?([a-z0-9 ]+(?= build))/: /\bhtc[ _\-]?([a-z0-9 ]+)/
  118. }], ["oppo", /\boppo[_]([a-z0-9]+)/], ["konka", /\bkonka[_\-]([a-z0-9]+)/], ["sonyericsson", /\bmt([a-z0-9]+)/], ["coolpad", /\bcoolpad[_ ]?([a-z0-9]+)/], ["lg", /\blg[\-]([a-z0-9]+)/], ["android", "android"], ["blackberry", "blackberry"]],
  119. r = [["wp",
  120. function(a) {
  121. return - 1 !== a.indexOf("windows phone ") ? /\bwindows phone (?:os )?([0-9.]+)/: -1 !== a.indexOf("xblwp") ? /\bxblwp([0-9.]+)/: -1 !== a.indexOf("zunewp") ? /\bzunewp([0-9.]+)/: "windows phone"
  122. }], ["windows", /\bwindows nt ([0-9.]+)/], ["macosx", /\bmac os x ([0-9._]+)/], ["ios",
  123. function(a) {
  124. return /\bcpu(?: iphone)? os /.test(a) ? /\bcpu(?: iphone)? os ([0-9._]+)/: -1 !== a.indexOf("iph os ") ? /\biph os ([0-9_]+)/: /\bios\b/
  125. }], ["yunos", /\baliyunos ([0-9.]+)/], ["android", /\bandroid[\/\- ]?([0-9.x]+)?/], ["chromeos", /\bcros i686 ([0-9.]+)/], ["linux", "linux"], ["windowsce", /\bwindows ce(?: ([0-9.]+))?/], ["symbian", /\bsymbian(?:os)?\/([0-9.]+)/], ["meego", /\bmeego\b/], ["blackberry", "blackberry"]],
  126. s = [["trident", p], ["webkit", /\bapplewebkit[\/]?([0-9.+]+)/], ["gecko", /\bgecko\/(\d+)/], ["presto", /\bpresto\/([0-9.]+)/], ["androidwebkit", /\bandroidwebkit\/([0-9.]+)/], ["coolpadwebkit", /\bcoolpadwebkit\/([0-9.]+)/]],
  127. t = [["sg", / se ([0-9.x]+)/], ["tw",
  128. function() {
  129. var a = g("theworld");
  130. return "undefined" != typeof a ? a: "theworld"
  131. }], ["360",
  132. function(a) {
  133. var b = g("360se");
  134. return "undefined" != typeof b ? b: -1 !== a.indexOf("360 aphone browser") ? /\b360 aphone browser \(([^\)]+)\)/: /\b360(?:se|ee|chrome|browser)\b/
  135. }], ["mx",
  136. function() {
  137. try {
  138. if (o && (o.mxVersion || o.max_version)) return {
  139. version: o.mxVersion || o.max_version
  140. }
  141. } catch(a) {}
  142. return /\bmaxthon(?:[ \/]([0-9.]+))?/
  143. }], ["qq", /\bm?qqbrowser\/([0-9.]+)/], ["green", "greenbrowser"], ["tt", /\btencenttraveler ([0-9.]+)/], ["lb",
  144. function(a) {
  145. if ( - 1 === a.indexOf("lbbrowser")) return ! 1;
  146. var b;
  147. try {
  148. o && o.LiebaoGetVersion && (b = o.LiebaoGetVersion())
  149. } catch(c) {}
  150. return {
  151. version: b || k
  152. }
  153. }], ["tao", /\btaobrowser\/([0-9.]+)/], ["fs", /\bcoolnovo\/([0-9.]+)/], ["sy", "saayaa"], ["baidu", /\bbidubrowser[ \/]([0-9.x]+)/], ["ie", p], ["mi", /\bmiuibrowser\/([0-9.]+)/], ["opera",
  154. function(a) {
  155. var b = /\bopera.+version\/([0-9.ab]+)/,
  156. c = /\bopr\/([0-9.]+)/;
  157. return b.test(a) ? b: c
  158. }], ["chrome", / (?:chrome|crios|crmo)\/([0-9.]+)/], ["uc",
  159. function(a) {
  160. return a.indexOf("ucbrowser/") >= 0 ? /\bucbrowser\/([0-9.]+)/: /\buc\/[0-9]/.test(a) ? /\buc\/([0-9.]+)/: a.indexOf("ucweb") >= 0 ? /\bucweb[\/]?([0-9.]+)?/: /\b(?:ucbrowser|uc)\b/
  161. }], ["android",
  162. function(a) {
  163. return - 1 !== a.indexOf("android") ? /\bversion\/([0-9.]+(?: beta)?)/: void 0
  164. }], ["safari", /\bversion\/([0-9.]+(?: beta)?)(?: mobile(?:\/[a-z0-9]+)?)? safari\//], ["webview", /\bcpu(?: iphone)? os (?:[0-9._]+).+\bapplewebkit\b/], ["firefox", /\bfirefox\/([0-9.ab]+)/], ["nokia", /\bnokiabrowser\/([0-9.]+)/]],
  165. u = {
  166. name: "na",
  167. version: k
  168. },
  169. v = function(a) {
  170. a = (a || "").toLowerCase();
  171. var b = {};
  172. i(a, q,
  173. function(a, c) {
  174. var d = parseFloat(c);
  175. b.device = {
  176. name: a,
  177. version: d,
  178. fullVersion: c
  179. },
  180. b.device[a] = d
  181. },
  182. b),
  183. i(a, r,
  184. function(a, c) {
  185. var d = parseFloat(c);
  186. b.os = {
  187. name: a,
  188. version: d,
  189. fullVersion: c
  190. },
  191. b.os[a] = d
  192. },
  193. b);
  194. var c = f(a);
  195. return i(a, s,
  196. function(a, d) {
  197. var e = d;
  198. c && (d = c.engineVersion || c.engineMode, e = c.engineMode);
  199. var f = parseFloat(d);
  200. b.engine = {
  201. name: a,
  202. version: f,
  203. fullVersion: d,
  204. mode: parseFloat(e),
  205. fullMode: e,
  206. compatible: c ? c.compatible: !1
  207. },
  208. b.engine[a] = f
  209. },
  210. b),
  211. i(a, t,
  212. function(a, d) {
  213. var e = d;
  214. c && ("ie" === a && (d = c.browserVersion), e = c.browserMode);
  215. var f = parseFloat(d);
  216. b.browser = {
  217. name: a,
  218. version: f,
  219. fullVersion: d,
  220. mode: parseFloat(e),
  221. fullMode: e,
  222. compatible: c ? c.compatible: !1
  223. },
  224. b.browser[a] = f
  225. },
  226. b),
  227. b
  228. };
  229. j = v(l + " " + m + " " + n),
  230. j.parse = v,
  231. a.Detector = j,
  232. "function" == typeof define && define("arale/detector/1.2.2/detector", [],
  233. function(a, b, c) {
  234. c.exports = j
  235. })
  236. } (window);
  237. </script>
  238. <script>
  239. !function(a) {
  240. function b() {
  241. return /\bcna=/.test(document.cookie)
  242. }
  243. function c(a, b, c) {
  244. b = b || "=";
  245. var d = [];
  246. for (var e in a) e && a.hasOwnProperty(e) && d.push(encodeURIComponent(e) + b + encodeURIComponent(a[e]));
  247. return d.join(c || "&")
  248. }
  249. function d() {
  250. var b = a.location.search,
  251. c = {};
  252. return b.replace(/([^?=&]+)(=([^&]*))?/g,
  253. function(a, b, d, e) {
  254. c[b] = e
  255. }),
  256. c
  257. }
  258. function e(a) {
  259. return "[object Function]" === Object.prototype.toString.call(a)
  260. }
  261. function f(a) {
  262. return "function" == typeof Array.isArray ? Array.isArray(a) : "[object Array]" === Object.prototype.toString.call(a)
  263. }
  264. function g(a) {
  265. var b = Array.prototype.slice.apply(arguments);
  266. if ("boolean" != typeof b[0] && b.unshift(a = !1), b.length < 2) return null;
  267. for (var c, d = 2,
  268. h = b[1], i = d, j = b.length; j > i; i++) if (c = b[i], c && "object" == typeof c) for (var k in c) {
  269. var l = c[k];
  270. if (l !== h && c.hasOwnProperty(k)) if (f(l)) h[k] = Array.prototype.concat.call(l);
  271. else if (a && l instanceof Object && !e(l) && !l.nodeType) {
  272. var m = h[k] || {};
  273. h[k] = g(!0, m, c[k])
  274. } else void 0 !== l && (h[k] = l)
  275. }
  276. return h
  277. }
  278. function h(a) {
  279. if ("http:" === o.protocol || "https:" === o.protocol) {
  280. var b = new Image(1, 1);
  281. b.onload = function() {
  282. b.onload = null
  283. },
  284. b.src = a
  285. } else try {
  286. var c = new XMLHttpRequest;
  287. c.open("GET", a, !0),
  288. c.onreadystatechange = function() {},
  289. c.send()
  290. } catch(d) {}
  291. }
  292. function i(a) {
  293. k.dispatchEvent(n, a,
  294. function() {
  295. k.click("titlebar-" + a)
  296. })
  297. }
  298. var j = a.Detector;
  299. "function" == typeof require && (j = require("arale/detector/1.2.2/detector"));
  300. var k, l, m = a,
  301. n = m.document,
  302. o = location,
  303. p = m.performance,
  304. q = "https:" !== o.protocol && "http:" !== o.protocol ? "https:": o.protocol,
  305. r = q + "//kcart.alipay.com/web/bi.do",
  306. s = q + "//kcart.alipay.com/web/1.do",
  307. t = q + "//log.mmstat.com/5.gif",
  308. u = 2e4,
  309. v = 8,
  310. w = "clk";
  311. p && p.timing ? l = p.timing.navigationStart: m._to && _to.start && (l = _to.start.getTime()),
  312. m.Tracker = k = function() {},
  313. k.prototype = {
  314. watch: function() {
  315. k.click("trac
  316. 1904
  317. ker-watch")
  318. }
  319. },
  320. k.extend = function(a) {
  321. for (var b = 1,
  322. c = arguments.length; c > b; b++) for (var d in arguments[b]) arguments[b].hasOwnProperty(d) && (a[d] = arguments[b][d]);
  323. return a
  324. },
  325. k.version = "1.0",
  326. k.enabled = !0,
  327. k.debug = !1,
  328. k.seedName = "seed",
  329. k.minInterval = 1e3;
  330. for (var x, y, z = n.getElementsByTagName("meta"), A = 0, B = z.length; B > A; A++) if (y = z[A].getAttribute("name"), y && "abtest" == y.toLowerCase()) {
  331. x = z[A].getAttribute("content");
  332. break
  333. }
  334. if (k.dispatchEvent = function(a, b, c) {
  335. a.addEventListener ? a.addEventListener(b, c, !1) : a.attachEvent ? a.attachEvent("on" + b,
  336. function(b) {
  337. c.call(a, b)
  338. }) : a["on" + b] = function(b) {
  339. c.call(a, b)
  340. }
  341. },
  342. k.getTarget = function(a) {
  343. a = a.touches[0];
  344. var b = a.target || a.srcElement;
  345. try {
  346. if (b && 3 === b.nodeType) return b.parentNode
  347. } catch(c) {}
  348. return b
  349. },
  350. k.send = function(d, e, f) {
  351. if ("string" != typeof d || !d) throw new Error("Invalid page");
  352. var i = {
  353. ref: e || "-",
  354. pg: d || "",
  355. r: (new Date).getTime(),
  356. v: k.version
  357. };
  358. x && (i.ABTest = x, i.pg += (i.pg.indexOf("?") >= 0 ? "&": "?") + "ABTest=" + x),
  359. f && g(i, f),
  360. i = c(i),
  361. k.debug ? a.console && console.log("Tracker debug: %s.", i) : (h(r + "?" + i), "http:" !== o.protocol && "https:" !== o.protocol || b() || (i = c({
  362. url: s + "?" + i
  363. }), h(t + "?" + i)))
  364. },
  365. n && m.location) {
  366. var C = location.href,
  367. D = n.referrer,
  368. E = Math.random(),
  369. F = {
  370. screen: "-x-",
  371. color: "-",
  372. BIProfile: "page"
  373. };
  374. if (m.screen && (F.screen = screen.width + "x" + screen.height, F.sc = screen.colorDepth + "-bit"), F.utmhn = location.hostname, F.rnd = E, m.analytic_var && (F.ana = analytic_var), j) {
  375. var G, H, I, J, K = navigator.userAgent,
  376. L = "";
  377. G = (j.os.name || "na") + "/" + (j.os.version || "-1"),
  378. H = (j.browser.name || "na") + "/" + (j.browser.version || "-1"),
  379. I = (j.engine.name || "na") + "/" + (j.engine.version || "-1"),
  380. J = (j.device.name || "na") + "/" + (j.device.version || "-1"),
  381. L = G + "|" + I + "|" + H + "|" + J;
  382. var M, N = "-1";
  383. "anclient" == K && (M = d().ttid, M && (N = M.split("_")[2]), L = "android/-1|webkit/-1|tbwebview/" + N + "|android/-1"),
  384. L.indexOf("na") > -1 && !parseInt(Math.random() * v, 10) && (L += "|" + K),
  385. j.currentUA = L,
  386. F._clnt = L
  387. }
  388. if (k.send(C, D, F), D = C, F = {},
  389. !parseInt(Math.random() * v, 10)) {
  390. F.BIProfile = "load";
  391. var O = 0,
  392. P = 0,
  393. Q = 0,
  394. R = 100,
  395. S = function() {
  396. S.invoked || (S.invoked = !0, O = (m._to && _to.ready ? _to.ready.getTime() : (new Date).getTime()) - l, O > u && (T.invoked = !0, F.tm = "-x-", k.send(C, "", F)))
  397. },
  398. T = function() {
  399. O > u || T.invoked || (T.invoked = !0, P = (m._to && _to.end ? _to.end.getTime() : (new Date).getTime()) - l, p && p.timing && (O = p.timing.domContentLoadedEventStart - p.timing.navigationStart, P = p.timing.loadEventStart - p.timing.navigationStart, Q = p.timing.responseEnd - p.timing.responseStart), U())
  400. },
  401. U = function() {
  402. return O ? (O > P && (O = P - R), 10 > O || (F.tm = "" + O + "x" + P + "x" + Q, F.rnd = E, k.send(C, "", F)), void 0) : (setTimeout(U, 50), void 0)
  403. };
  404. l && (m._to && _to.ready ? S() : m.YAHOO && YAHOO.util && YAHOO.util.Event ? YAHOO.util.Event.onDOMReady(S) : m.jQuery ? jQuery(S) : m.Y && Y.on ? Y.on("domready", S) : S(), m._to && _to.end ? T() : (m.setTimeout(T, 8 * u), k.dispatchEvent(m, "load", T), k.dispatchEvent(m, "unload", T)))
  405. }
  406. }
  407. i("back"),
  408. i("title"),
  409. i("rightitem"),
  410. i("slaverightitem"),
  411. n && k.dispatchEvent(n, "touchstart",
  412. function(a) {
  413. var b = k.getTarget(a);
  414. if (b && b.nodeType) {
  415. for (; b && "HTML" != b.nodeName && "function" == typeof b.getAttribute && !b.getAttribute(k.seedName);) b = b.parentNode;
  416. if (b && 1 === b.nodeType && "HTML" != b.nodeName) {
  417. var c, d, e;
  418. "A" == b.nodeName && (d = b.getAttribute("href") || "", e = d.match(/[?&]_scType=([^&]+)/), e && (c = {
  419. _scType: e[1]
  420. })),
  421. k.click(b.getAttribute(k.seedName), c)
  422. }
  423. }
  424. }),
  425. k.click = function() {
  426. var a = {},
  427. b = location.href.split("?").shift(),
  428. d = b.indexOf(";jsessionid=");
  429. return d >= 0 && (b = b.substr(0, d)),
  430. a[w] = location.href,
  431. function(d, e) {
  432. if (d) {
  433. var f = d.split(":", 2);
  434. f.length >= 2 || f.unshift(w);
  435. var h = f[0];
  436. if (d = f[1]) {
  437. var i = {
  438. seed: d
  439. };
  440. e && g(i, e),
  441. i = c(i);
  442. var j, l = b + "?" + i;
  443. h && (j = {
  444. BIProfile: h
  445. }),
  446. k.send(l, a[h] || "", j),
  447. a[h] = l
  448. }
  449. }
  450. }
  451. } (),
  452. k.log = function(a, b) {
  453. k.click((b || "syslog") + ":" + a)
  454. },
  455. k.error = function(a) {
  456. k.click("syserr:" + a)
  457. },
  458. k.calc = function(a, b) {
  459. k.click("calc:" + a, {
  460. value: b
  461. })
  462. },
  463. "function" == typeof define && define("alipay/mtracker/1.0.3/mtracker", [],
  464. function(a, b, c) {
  465. c.export = k
  466. })
  467. } (window);
  468. </script>
  469. <!-- CMS:无线/无线wap全站通用/mtracker结束:wap/wap_common/mtracker.vm --> <!-- CMS 无线监控埋点 结束 -->
  470. <meta name="apple-mobile-web-app-capable" content="yes"/>
  471. <meta name="apple-mobile-web-app-status-bar-style" content="black"/>
  472. <meta name="format-detection" content="telephone=no"/>
  473. <meta name="format-detection" content="email=no"/>
  474. <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0;"
  475. name="viewport"/>
  476. <link rel='stylesheet' href='https://a./u/css/201212/1lu5dGaFum.css'/>
  477. </head>
  478. <body>
  479. <a href="https://m.alipay.com/offlineIndex.htm?sx=111" id="openApp" style="display: none">支付宝钱包客户端</a>
  480. <script type="text/javascript">
  481. document.getElementById('openApp').onclick = function(e){
  482. // 通过iframe的方式试图打开APP,如果能正常打开,会直接切换到APP,并自动阻止a标签的默认行为
  483. // 否则打开a标签的href链接
  484. var ifrSrc = 'alipays://platformapi/startApp?appId=20000001&actionType=20000002&tabSelectedIndex=0';
  485. if(!ifrSrc){
  486. return;
  487. }
  488. var ifr = document.createElement('iframe');
  489. ifr.src = ifrSrc ;
  490. ifr.style.display = 'none';
  491. document.body.appendChild(ifr);
  492. setTimeout(function(){
  493. document.body.removeChild(ifr);

  494. },1000);

  495. };
  496. if(document.all) {
  497. document.getElementById('openApp').click();
  498. }
  499. // 其它浏览器
  500. else {
  501. var e = document.createEvent("MouseEvents");
  502. e.initEvent("click", true, true);
  503. document.getElementById("openApp").dispatchEvent(e);
  504. }
  505. </script>
  506. <div class="t-center pd-all10">
  507. <section><img src="https://i./e/201306/SXTDtuxMN.png"/></section>
  508. <div class="fm-item">
  509. <a href="http://cdndownload.alipay.com/mgw/and/1/alipay_wap_dc.apk" class="flex btn btn-ok mg-b8">免费下载</a>
  510. <p>m.alipay.com于2013年12月26日下线,请下载支付宝钱包继续使用支付宝服务</p>
  511. </div>
  512. </div>

  513. <!-- CMS 无线监控埋点 开始 -->
  514. <!-- CMS:无线/无线wap全站通用/无线wap通用页脚开始:wap/wap_common/footer.vm --><!--智能用户行为分析相关-->
  515. <script type="text/javascript" charset="utf-8" src="https://a./ar/??alipay.smartracker-1.1.js"></script>
  516. <!-- CMS:无线/无线wap全站通用/无线wap通用页脚结束:wap/wap_common/footer.vm --> <!-- CMS 无线监控埋点 结束 -->
  517. </body>
  518. </html>
  519. <!--悄悄的告诉你们,head标签内的js没有任何用处,无视即可 -->





    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多