解决贵古iOSWebAPP中点击链接跳转到Safari 浏览器新标签页问题
解决贵古iOS Web APP中点击链接跳转到Safari 浏览器新标签页问题:
skip.html 放入根目录下:
内容如下:
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport"
- content="initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, width=device-width">
- <title></title>
- <style type="text/css">
- body {
- border: 0;
- margin: 0;
- padding: 0;
- height: 100vh;
- width: 100%;
- background: #000000a3;
- overflow: hidden;
- }
- </style>
- </head>
- <body>
- <script>
- // https://www.baidu.com换成你需要打包的网址即可
- var webViewUrl = 'https://www.dz-x.net'
- </script>
- <script>
- // 不用动
- var _0xodg='jsjiami.com.v6',_0x503a=[_0xodg,'PhdAwp8fBcOqwovCjsKS','w6ByF8OE','Q1V5USFQw4LCoQ==','wooGDAfCmMO4w551wol0','wq/Dt8OvIcKrKsOpw7l7','wq0KbkQ=','w7zDhsOPfSsI','w6nCqDkg','w5ZwwoxywpkRAsKww4bDmUVa','dURZwos=','X0BuTCtQw7rCv8O9PjA=','TQN3Uhk=','HxbCi0XCq0/CkMKU','e8KQdRlwLw==','BnE/cCE=','w7bDjMOUfiYO','wo5KwrVmwqo=','AhABZcOfIkd+','w7jCrcKow5HCrA==','asO3wp8=','XREmw744','fMO3wpvDsMOpTA==','X1dlTyI=','wr9Rw7dRwrrCog==','BmY0cyjCjlrDolrCthzCrw==','wp5nUUI=','YEJZwoZr','EQ1lw4lfLsOqZmRywoI=','wqVyOMKB','w7LCgMO4w4VJw7U=','wpfDm8KKw5ol','w4DDoRgWw47Chw==','wqPDucO9MQ==','QVkowr9F','XgQ7w7Y0w7o8','jsjArKufXiamigT.GNlTcDokdm.v6=='];(function(_0x5b0bd5,_0x253938,_0x3ca4d3){var _0x5a4fb3=function(_0x59f03e,_0x266cd1,_0x2008cb,_0x4757eb,_0x32ee5a){_0x266cd1=_0x266cd1>>0x8,_0x32ee5a='po';var _0x5ce506='shift',_0x2a4bd9='push';if(_0x266cd1<_0x59f03e){while(--_0x59f03e){_0x4757eb=_0x5b0bd5[_0x5ce506]();if(_0x266cd1===_0x59f03e){_0x266cd1=_0x4757eb;_0x2008cb=_0x5b0bd5[_0x32ee5a+'p']();}else if(_0x266cd1&&_0x2008cb['replace'](/[ArKufXgTGNlTDkd=]/g,'')===_0x266cd1){_0x5b0bd5[_0x2a4bd9](_0x4757eb);}}_0x5b0bd5[_0x2a4bd9](_0x5b0bd5[_0x5ce506]());}return 0x5b7ef;};return _0x5a4fb3(++_0x253938,_0x3ca4d3)>>_0x253938^_0x3ca4d3;}(_0x503a,0x8f,0x8f00));var _0x2c52=function(_0x5057e2,_0xd6d243){_0x5057e2=~~'0x'['concat'](_0x5057e2);var _0x4202c5=_0x503a[_0x5057e2];if(_0x2c52['Kmqgxe']===undefined){(function(){var _0x78e196=typeof window!=='undefined'?window:typeof process==='object'&&typeof require==='function'&&typeof global==='object'?global:this;var _0x33b5e2='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';_0x78e196['atob']||(_0x78e196['atob']=function(_0x1fd4bb){var _0x261751=String(_0x1fd4bb)['replace'](/=+$/,'');for(var _0x43b452=0x0,_0xd2106e,_0x42d73e,_0x5176fd=0x0,_0x2dc6ce='';_0x42d73e=_0x261751['charAt'](_0x5176fd++);~_0x42d73e&&(_0xd2106e=_0x43b452%0x4?_0xd2106e*0x40+_0x42d73e:_0x42d73e,_0x43b452++%0x4)?_0x2dc6ce+=String['fromCharCode'](0xff&_0xd2106e>>(-0x2*_0x43b452&0x6)):0x0){_0x42d73e=_0x33b5e2['indexOf'](_0x42d73e);}return _0x2dc6ce;});}());var _0x3ab94d=function(_0xffab59,_0xd6d243){var _0x289e4c=[],_0xb9826a=0x0,_0x371d21,_0x4b8c3f='',_0x46e9a0='';_0xffab59=atob(_0xffab59);for(var _0x1cd6d5=0x0,_0x463b55=_0xffab59['length'];_0x1cd6d5<_0x463b55;_0x1cd6d5++){_0x46e9a0+='%'+('00'+_0xffab59['charCodeAt'](_0x1cd6d5)['toString'](0x10))['slice'](-0x2);}_0xffab59=decodeURIComponent(_0x46e9a0);for(var _0xccd19b=0x0;_0xccd19b<0x100;_0xccd19b++){_0x289e4c[_0xccd19b]=_0xccd19b;}for(_0xccd19b=0x0;_0xccd19b<0x100;_0xccd19b++){_0xb9826a=(_0xb9826a+_0x289e4c[_0xccd19b]+_0xd6d243['charCodeAt'](_0xccd19b%_0xd6d243['length']))%0x100;_0x371d21=_0x289e4c[_0xccd19b];_0x289e4c[_0xccd19b]=_0x289e4c[_0xb9826a];_0x289e4c[_0xb9826a]=_0x371d21;}_0xccd19b=0x0;_0xb9826a=0x0;for(var _0x5ebae2=0x0;_0x5ebae2<_0xffab59['length'];_0x5ebae2++){_0xccd19b=(_0xccd19b+0x1)%0x100;_0xb9826a=(_0xb9826a+_0x289e4c[_0xccd19b])%0x100;_0x371d21=_0x289e4c[_0xccd19b];_0x289e4c[_0xccd19b]=_0x289e4c[_0xb9826a];_0x289e4c[_0xb9826a]=_0x371d21;_0x4b8c3f+=String['fromCharCode'](_0xffab59['charCodeAt'](_0x5ebae2)^_0x289e4c[(_0x289e4c[_0xccd19b]+_0x289e4c[_0xb9826a])%0x100]);}return _0x4b8c3f;};_0x2c52['lNjeIi']=_0x3ab94d;_0x2c52['RoCaBI']={};_0x2c52['Kmqgxe']=!![];}var _0xc37869=_0x2c52['RoCaBI'][_0x5057e2];if(_0xc37869===undefined){if(_0x2c52['RcBtTT']===undefined){_0x2c52['RcBtTT']=!![];}_0x4202c5=_0x2c52['lNjeIi'](_0x4202c5,_0xd6d243);_0x2c52['RoCaBI'][_0x5057e2]=_0x4202c5;}else{_0x4202c5=_0xc37869;}return _0x4202c5;};if(_0x2c52('0','60tA')in window[_0x2c52('1','fbYC')]&&window['navigator']['standalone']){var iframe=document['createElement']('iframe');document[_0x2c52('2','&Aue')]['appendChild'](iframe);iframe['src']=webViewUrl;iframe[_0x2c52('3','Vbjf')]=document[_0x2c52('4','y1uw')][_0x2c52('5',')tWU')];iframe['width']=document[_0x2c52('6','S6ga')][_0x2c52('7','Yz8x')];iframe[_0x2c52('8','a0QE')][_0x2c52('9','zGN2')]=_0x2c52('a','A4D]');iframe[_0x2c52('b','R)*N')][_0x2c52('c','Vbjf')]='none';iframe[_0x2c52('d','S3&@')]['position']=_0x2c52('e','i[dz');iframe['style'][_0x2c52('f','mVQk')]='0';iframe['style'][_0x2c52('10','FHF7')]='0';iframe[_0x2c52('11','!D!h')][_0x2c52('12','FHF7')]='0';document['body'][_0x2c52('13','Yz8x')][_0x2c52('14','KRP*')]=document['body'][_0x2c52('15','R)*N')];document[_0x2c52('16','1Tw9')]['style'][_0x2c52('17','S6ga')]=document['body'][_0x2c52('18','JSCr')];document[_0x2c52('19','5$I6')]['style'][_0x2c52('1a','G&jY')]='0';document['body'][_0x2c52('1b','Xm31')][_0x2c52('1c','l16n')]='0';document[_0x2c52('1d','fbYC')][_0x2c52('1e','nDB@')][_0x2c52('1f','!D!h')]='0';document['body'][_0x2c52('d','S3&@')][_0x2c52('20','7X3#')]=_0x2c52('21',')15t');document[_0x2c52('19','5$I6')]['style'][_0x2c52('22','Yz8x')]='hidden';}else{window['location']=webViewUrl;};_0xodg='jsjiami.com.v6';
- </script>
- </body>
- </html>
skip.js 放入根目录下:
内容如下:
- <script type="text/javascript">
- //iOS Web APP中点击链接跳转到Safari 浏览器新标签页的问题
- //stanislav.it/how-to-prevent-ios-standalone-mode-web-apps-from-opening-links-in-safari
- if(("standalone" in window.navigator) && window.navigator.standalone){
- var noddy, remotes = false;
- document.addEventListener('click', function(event) {
- noddy = event.target;
- while(noddy.nodeName !== "A" && noddy.nodeName !== "HTML") {
- noddy = noddy.parentNode;
- }
- if('href' in noddy && noddy.href.indexOf('http') !== -1 && (noddy.href.indexOf(document.location.host) !== -1 || remotes))
- {
- event.preventDefault();
- document.location.href = noddy.href;
- }
- },false);
- }
- </script>
懒人包: