{"id":128901,"date":"2020-06-19T00:57:26","date_gmt":"2020-06-18T16:57:26","guid":{"rendered":"http:\/\/4563.org\/?p=128901"},"modified":"2020-06-19T00:57:26","modified_gmt":"2020-06-18T16:57:26","slug":"chrome-%e7%9a%84%e4%ba%8b%e4%bb%b6%e7%9b%91%e5%90%ac%e6%96%ad%e7%82%b9%ef%bc%88event-listener-breakpoints%ef%bc%89%e8%83%bd%e7%9b%91%e5%90%ac%ef%bc%9a-alert-%e5%90%97%ef%bc%9f","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=128901","title":{"rendered":"chrome \u7684\u4e8b\u4ef6\u76d1\u542c\u65ad\u70b9\uff08event listener breakpoints\uff09\u80fd\u76d1\u542c\uff1a alert \u5417\uff1f"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  chrome \u7684\u4e8b\u4ef6\u76d1\u542c\u65ad\u70b9\uff08event listener breakpoints\uff09\u80fd\u76d1\u542c\uff1a alert \u5417\uff1f               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : shanlanlan <\/span>  <span><i><\/i> 5<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<h1>\u5728\u9875\u9762 debug \u8c03\u8bd5\u7684\u65f6\u5019\uff0c\u7ecf\u5e38\u88ab alert \u6253\u65ad\uff0c\u6709\u529e\u6cd5\u76f4\u63a5\u5b9a\u4f4d\u5230\u8fd9\u4e2a alert \u5417\uff1f<\/h1>\n<p> <\/p>\n<h1>\u4f8b\u5982\uff1aclick \u4e8b\u4ef6\u53ef\u4ee5\u8bbe\u7f6e\u4e8b\u4ef6\u65ad\u70b9\uff0c\u90a3\u4e48 alert \u65b9\u6cd5\u53ef\u4ee5\u65ad\u70b9\u5417\uff1f<\/h1>\n<p>  <\/p>\n<h1>\u865a\u5fc3\u8bf7\u6559\u5927\u4f6c\u3002<\/h1>\n<p>  <\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>6<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"2220463\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Mutoo <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             alert \u662f\u5168\u5c40\u51fd\u6570\uff0c\u76f4\u63a5\u66ff\u6362\u6389\uff1a<\/p>\n<p>origAlert = alert;<br \/>alert = (&#8230;parmas) =&gt; {<br \/> debugger;<br \/> origAlert(&#8230;params)<br \/>}<\/p>\n<p>\u7136\u540e\u65ad\u70b9\u540e\u770b Call Stack \u5373\u53ef\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2220464\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : rioshikelong121 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u63a7\u5236\u53f0 debug(window.alert) \u8bd5\u8bd5                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2220465\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : azcvcza <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u53c2\u7167 js \u9ad8\u7ea7\u7a0b\u5e8f\u8bbe\u8ba1\u7684\u4f8b\u5b50\uff0c\u53ef\u4ee5\u7ed9 Function prototype \u7ed1 before \u548c after\uff0c\u7136\u540e\u4f20\u5165 window.alert\uff0c\u5728 before \u548c after \u91cc\u8c03 debugger \u5427                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2220466\" 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>                                                             @rioshikelong121 #2 \u539f\u6587\uff1a\u201c\u63a7\u5236\u53f0 debug(window.alert) \u8bd5\u8bd5\u201d<br \/>======<br \/>\u56de\u590d\uff1a\u4eb2\u6d4b\u6709\u6548\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2220467\" 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>                                                             @rioshikelong121 #2 \u539f\u6587\uff1a\u201c\u63a7\u5236\u53f0 debug(window.alert) \u8bd5\u8bd5\u201d<br \/>======<br \/>\u56de\u590d\uff1a\u611f\u8c22\uff0c\u5df2\u7ecf\u6210\u529f\u89e3\u51b3\u4e86\u95ee\u9898\u3002\u5b9a\u4f4d\u5230\u4ee3\u7801\u540e\uff0c\u76f4\u63a5\u628a\u7f51\u7ad9\u7684 if \u5224\u65ad\u6539\u4e3a\u4e86:if(true)\u4e86\uff0c\u8c03\u8bd5\u901a\u8fc7\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2220468\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : rioshikelong121 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @shanlanlan \u55ef \u6ca1\u4e8b\u53ef\u4ee5\u770b\u770b Chrome DevTools \u7684\u6587\u6863\u3002 \u8fd8\u662f\u6709\u5f88\u591a\u65b0\u5947\u7684\u529f\u80fd\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>chrome \u7684\u4e8b\u4ef6\u76d1\u542c\u65ad\u70b9\uff08ev&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\/128901"}],"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=128901"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/128901\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=128901"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=128901"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=128901"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}