{"id":127845,"date":"2020-06-06T15:44:19","date_gmt":"2020-06-06T07:44:19","guid":{"rendered":"http:\/\/4563.org\/?p=127845"},"modified":"2020-06-06T15:44:19","modified_gmt":"2020-06-06T07:44:19","slug":"%e8%af%b7%e9%97%ae%e5%a6%82%e4%bd%95%e8%a7%a6%e5%8f%91%e7%a7%bb%e5%8a%a8%e7%ab%af%e7%9a%84%e7%82%b9%e5%87%bb%e5%8a%a8%e4%bd%9c%ef%bc%9f","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=127845","title":{"rendered":"\u8bf7\u95ee\u5982\u4f55\u89e6\u53d1\u201c\u79fb\u52a8\u7aef\u201d\u7684\u70b9\u51fb\u52a8\u4f5c\uff1f"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u8bf7\u95ee\u5982\u4f55\u89e6\u53d1\u201c\u79fb\u52a8\u7aef\u201d\u7684\u70b9\u51fb\u52a8\u4f5c\uff1f               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : shanlanlan <\/span>  <span><i><\/i> 7<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u5c1d\u8bd5\u7ed9\uff1am.taobao.com \u6dfb\u52a0 JavaScript \u529f\u80fd\u7684\u65f6\u5019\uff0c\u53d1\u73b0\u6309\u94ae\u4e0d\u80fd\u7528:domNode.click()\u6a21\u62df\u70b9\u51fb\u3002 \u5206\u6790\u5143\u7d20\u53d1\u73b0\u6309\u94ae\u5176\u5b9e\u662f div\uff0c\u5e76\u4e0d\u662f button \u3002\u5982\u679c\u4e0d\u4f7f\u7528 chrome \u6d4f\u89c8\u5668\u7684\u6a21\u62df\u79fb\u52a8\u8bbe\u5907\u8bbf\u95ee\uff0c\u6539\u6210 pc \u8bbf\u95ee\uff0c\u9f20\u6807\u662f\u4e0d\u80fd\u70b9\u51fb\u7684\u3002 \u7ed3\u5408\u67e5\u8be2\u7684\u8d44\u6599\uff0c\u6dd8\u5b9d\u79fb\u52a8\u7f51\u9875\u5e94\u8be5\u662f\u76d1\u542c\u4e86&#8221;touch&#8221;\u4e8b\u4ef6\u3002 \u6211\u4f7f\u7528\u4e86\u4e0b\u9762\u7684\u4ee3\u7801\u5c1d\u8bd5\uff0c\u672a\u6210\u529f\uff1a<\/p>\n<pre><code>\/\/\u9009\u5b9a\u8981\u64cd\u4f5c\u7684 dom \u8282\u70b9 var elem =  document.querySelector(\"#submitBlock_1 &gt; div &gt; div &gt; div &gt; div:nth-child(3) &gt; div:nth-child(2)\");  \/\/ \u521b\u5efa\u4e8b\u4ef6. var event = document.createEvent('Events');  \/\/ \u521d\u59cb\u5316\u4e00\u4e2a\u70b9\u51fb\u4e8b\u4ef6\uff0c\u53ef\u4ee5\u5192\u6ce1\uff0c\u65e0\u6cd5\u88ab\u53d6\u6d88 event.initEvent('touchstart', true, false);   \/\/ \u89e6\u53d1\u70b9\u51fb\u4e8b\u4ef6 elem.dispatchEvent(event);  <\/code><\/pre>\n<h1>\u8bf7\u95ee\u5404\u4f4d\uff0c\u5982\u4f55\u4f7f\u7528\u4ee3\u7801\u6a21\u62df\u201c\u79fb\u52a8\u7aef\u70b9\u51fb\u201d\uff1f<\/h1>\n<p>  <\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>12<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"2156733\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : wxsm <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8bd5\u8bd5 touchend                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2156734\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : shanlanlan <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @wxsm #1 \u539f\u6587\uff1a\u201c\u8bd5\u8bd5 touchend\u201d<br \/>======<br \/>\u56de\u590d\uff1a#1 \u5176\u5b9e\u201contouchstart\u201d\u80fd\u89e6\u53d1\u3002\u4f46\u662f\u9875\u9762\u7684\u6309\u94ae\u6ca1\u6709\u53cd\u5e94\u3002\u6bd4\u5982\u4ee3\u7801\u89e6\u53d1\u201contouchstart\u201d\u540e\uff0c\u63a7\u5236\u53f0\u80fd\u6253\u5370\u51fa\u6dd8\u5b9d\u7684\u951a\u70b9\u65e5\u5fd7\u4fe1\u606f\u3002\u8bf4\u660e\u951a\u70b9\u662f\u76d1\u542c\u4e86\u8fd9\u4e2a\u4e8b\u4ef6\u3002\u6211\u4e5f\u5c1d\u8bd5\u8fc7\u89e6\u53d1`touchend`\uff0c\u6309\u94ae\u6ca1\u6709\u53cd\u5e94\u3002\u6211\u731c\u60f3\u89e6\u53d1\u6309\u94ae\u7684\u6548\u679c\u4e0d\u662f\u8fd9 2 \u4e2a\u4e8b\u4ef6\u3002\u6211\u518d\u8bd5\u8bd5\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2156735\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : shanlanlan <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6d4b\u8bd5\u94fe\u63a5\u5728\u8fd9\u91cc\uff0c\u8fd9\u91cc\u9762\u7684\u52fe\u9009\u548c\u63d0\u4ea4\u8ba2\u5355\u6309\u94ae\u90fd\u4e0d\u80fd\u76f4\u63a5\u901a\u8fc7 click \u89e6\u53d1\u3002\u4e5f\u5c1d\u8bd5\u8fc7\u201ctouchstart \u548c touchend\u201d\u3002\u5747\u4e0d\u80fd\u89e6\u53d1\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2156736\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : shanlanlan <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             https:\/\/main.m.taobao.com\/order\/index.html?buyNow=true&amp;buyParam=602659642364_1_4387862094596                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2156737\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : pinkSlime <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             devtools \u91cc\u9762\u7684 Event Listeners \u91cc\u9762\u7785\u4e00\u773c\u5bf9\u5e94\u7684\u5143\u7d20\u5230\u5e95\u7ed1\u4e86\u4ec0\u4e48\u4e8b\u4ef6                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2156738\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : shanlanlan <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @pinkSlime #5 \u539f\u6587\uff1a\u201cdevtools \u91cc\u9762\u7684 Event Listeners \u91cc\u9762\u7785\u4e00\u773c\u5bf9\u5e94\u7684\u5143\u7d20\u5230\u5e95\u7ed1\u4e86\u4ec0\u4e48\u4e8b\u4ef6\u201d<br \/>======<br \/>\u56de\u590d\uff1a#5 \u7ed1\u5b9a\u7684\u8fd8\u633a\u591a\uff1a<br \/>![image.png]( https:\/\/i.loli.net\/2020\/06\/20\/VZr1zTUyOxdFEXG.png)                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2156739\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : mostkia <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8bd5\u8bd5\u5408\u6210\u4e8b\u4ef6\uff0c\u76f4\u63a5\u6a21\u62df\u4ea4\u4e92\u64cd\u4f5c                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2156740\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : shanlanlan <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @mostkia #7 \u539f\u6587\uff1a\u201c\u8bd5\u8bd5\u5408\u6210\u4e8b\u4ef6\uff0c\u76f4\u63a5\u6a21\u62df\u4ea4\u4e92\u64cd\u4f5c\u201d<br \/>======<br \/>\u56de\u590d\uff1a#7 \u8fd8\u6ca1\u8bd5\u8fc7\uff0c\u6211\u67e5\u67e5\u8d44\u6599\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2156741\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : mostkia <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @shanlanlan \u55ef\uff0cjs \u7684\u5408\u6210\u4e8b\u4ef6\u80fd\u591f\u4e3b\u52a8\u6a21\u62df UI \u4ea4\u4e92\u6fc0\u6d3b\u76f8\u5173\u7684\u4e8b\u4ef6\u53e5\u67c4\uff0c\u5177\u4f53\u65b9\u6cd5\u5982\u4e0b\uff1a<br \/>&#8220;`<br \/>\/\/\u6ce8\u518c\u4e8b\u4ef6\u7c7b\u578b\uff08\u6211\u8fd9\u8fb9\u9009\u4e86\u6700\u5e38\u89c1\u7684\u9f20\u6807\u4e8b\u4ef6\u4f5c\u4e3a\u4f8b\u5b50\uff09<br \/>var evObj = document.createEvent(&#8216;MouseEvents&#8217;);<br \/>\/\/\u6a21\u62df\u573a\u666f\uff08\u53c2\u6570\u5f88\u591a\uff0c\u6709\u4e9b\u6211\u4e5f\u4e0d\u592a\u61c2\uff0c\u5927\u90fd\u662f\u5173\u4e8e\u5f53\u524d\u4e8b\u4ef6\u6a21\u62df\u9f20\u6807\u7684\u72b6\u6001\u7684\uff09<br \/>evObj.initMouseEvent(&#8216;click&#8217;,true,true,window,1,10,10,10,10,false,false,false,false,2,null);<br \/>\/\/\u5c06\u8bbe\u5b9a\u597d\u7684\u5408\u6210\u4e8b\u4ef6\u4f5c\u7528\u5230\u4f60\u60f3\u624b\u52a8\u6fc0\u6d3b\u7684\u5143\u7d20\u4e0a<br \/>document.querySelector(&#8216;.conInt_tag_btn &gt; a&#8217;).dispatchEvent(evObj);<br \/>&#8220;`<br \/>\u4e0d\u8fc7\u9700\u8981\u6ce8\u610f\u7684\u4e00\u70b9\uff0c\u6211\u8fd9\u8fb9\u5b9e\u9645\u4f7f\u7528\u65f6\u53d1\u73b0\uff0c\u5fc5\u987b\u662f\u7ed1\u5b9a\u4e86\u81ea\u5b9a\u4e49\u7684\u4e8b\u4ef6\u7684\u5143\u7d20\u624d\u6709\u6548\uff0c\u65e0\u6cd5\u6fc0\u6d3b\u6d4f\u89c8\u5668\u9ed8\u8ba4\u4e8b\u4ef6\uff0c\u6bd4\u5982\u4e00\u4e2a\u6ca1\u6709\u4efb\u4f55 js \u4ee3\u7801\u5173\u8054\u7684\u8d85\u94fe\u63a5&lt;a&gt;\uff0c\u624b\u52a8\u70b9\u51fb\u80af\u5b9a\u80fd\u8df3\u8f6c\uff0c\u4f46\u5b83\u662f\u6ca1\u6709\u7ed1\u5b9a js \u4e8b\u4ef6\uff0c\u4f7f\u7528\u8be5\u65b9\u6cd5\u5c31\u65e0\u6cd5\u4e3b\u52a8\u6fc0\u6d3b\u3002\u5177\u4f53\u53ef\u4ee5\u767e\u5ea6\u4e00\u4e0b\u76f8\u5173\u7684\u8d44\u6599\uff0c\u7f51\u4e0a\u5f88\u591a\u7684\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2156742\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ccraohng <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             TouchEvent \u5408\u6210 touchstart touchend \u4e8b\u4ef6, \u4e0d\u8fc7 isTrusted \u76f4\u63a5\u964d\u7ef4\u6253\u51fb                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2156743\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : shanlanlan <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @ccraohng #10 \u539f\u6587\uff1a\u201cTouchEvent \u5408\u6210 touchstart touchend \u4e8b\u4ef6, \u4e0d\u8fc7 isTrusted \u76f4\u63a5\u964d\u7ef4\u6253\u51fb\u201d<br \/>======<br \/>\u56de\u590d\uff1a#10 <\/p>\n<p>\u5c1d\u8bd5\u4e0b\u9762\u4ee3\u7801\u8fdb\u884c\u5408\u6210\u64cd\u4f5c\uff0c\u4f46\u662f\u5982\u4f60\u6240\u8ff0\uff0c\u786e\u5b9e\u5728\u6e90\u4ee3\u7801\u91cc\u53d1\u73b0\u4e86`isTrusted`\u65b9\u6cd5\u3002\u800c\u4e14\u662f\u5728\u6bcf\u6b21\u89e6\u6478\u7684\u65f6\u5019\u90fd\u4f1a\u8c03\u7528\u3002<br \/>&#8220;`javascript<br \/>var elem = document.querySelector(&#8220;#confirmOrder_1 &gt; div.tpl-wrapper &gt; div &gt; div&#8221;);<\/p>\n<p>var touch = new Touch({<br \/> identifier: 42,<br \/> target: elem,<br \/> clientX: 200,<br \/> clientY: 200,<br \/> screenX: 300,<br \/> screenY: 300,<br \/> pageX: 200,<br \/> pageY: 200,<br \/> radiusX: 5,<br \/> radiusY: 5<br \/>});<\/p>\n<p>\/\/\u5f00\u59cb\u5408\u6210\u4e8b\u4ef6<\/p>\n<p>\/\/ \u521b\u5efa\u4e8b\u4ef6.<br \/>var event = document.createEvent(&#8216;Events&#8217;);<\/p>\n<p>\/\/ \u521d\u59cb\u5316\u4e00\u4e2a\u6309\u4e0b\u4e8b\u4ef6<br \/>var touchEventStart = new TouchEvent(&#8220;touchstart&#8221;, {<br \/> cancelable: true,<br \/> bubbles: true,<br \/> composed: true,<br \/> touches: [touch],<br \/> targetTouches: [touch],<br \/> changedTouches: [touch]<br \/>});<br \/>\/\/ \u89e6\u53d1\u6309\u4e0b\u4e8b\u4ef6<br \/>elem.dispatchEvent(touchEventStart);<\/p>\n<p>\/\/ \u521d\u59cb\u5316\u4e00\u4e2a\u62ac\u8d77\u4e8b\u4ef6<br \/>var touchEventEnd = new TouchEvent(&#8220;touchend&#8221;, {<br \/> cancelable: true,<br \/> bubbles: true,<br \/> composed: true,<br \/> touches: [touch],<br \/> targetTouches: [touch],<br \/> changedTouches: [touch]<br \/>});<br \/>\/\/ \u89e6\u53d1\u70b9\u51fb\u62ac\u8d77\u4e8b\u4ef6<br \/>elem.dispatchEvent(touchEventEnd);<br \/>&#8220;`<\/p>\n<p>\u7f51\u7ad9\u88ab\u6df7\u6dc6\u8fc7\u7684\u4ee3\u7801\u5730\u5740\uff1a https:\/\/g.alicdn.com\/secdev\/sufei_data\/3.8.7\/index.js:formatted<br \/>&#8220;`javascript<br \/> function a(n) {<br \/> Y = n.isTrusted;<br \/> var t = n.touches[0];<br \/> K = t.clientX,<br \/> Z = t.clientY,<br \/> F++,<br \/> nn = o(tn, rn)<br \/> }<br \/>&#8220;`                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2156744\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : shanlanlan <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             11L \u7684 js \u94fe\u63a5\u6709\u8bef\uff1a https:\/\/g.alicdn.com\/secdev\/sufei_data\/3.8.7\/index.js<\/p>\n<p>\u53e6\u5916\u76ee\u524d\u5931\u53bb\u5934\u7eea\uff0c\u6682\u672a\u89e3\u51b3\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u8bf7\u95ee\u5982\u4f55\u89e6\u53d1\u201c\u79fb\u52a8\u7aef\u201d\u7684\u70b9\u51fb\u52a8\u4f5c\uff1f&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/127845"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=127845"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/127845\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=127845"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=127845"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=127845"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}