{"id":27749,"date":"2024-11-24T17:15:23","date_gmt":"2024-11-24T09:15:23","guid":{"rendered":"https:\/\/fwq.ai\/blog\/27749\/"},"modified":"2024-11-24T17:15:23","modified_gmt":"2024-11-24T09:15:23","slug":"%e7%a6%81%e6%ad%a2%e6%b5%8f%e8%a7%88%e5%99%a8%e9%9a%90%e8%97%8f%e5%85%83%e7%b4%a0%e8%ae%be%e7%bd%ae%e9%98%b2%e6%ad%a2%e7%94%a8%e6%88%b7%e7%af%a1%e6%94%b9%e7%bd%91%e9%a1%b5%e6%97%b6%ef%bc%8c%e5%a6%82","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/27749\/","title":{"rendered":"\u7981\u6b62\u6d4f\u89c8\u5668\u9690\u85cf\u5143\u7d20\u8bbe\u7f6e\u9632\u6b62\u7528\u6237\u7be1\u6539\u7f51\u9875\u65f6\uff0c\u5982\u4f55\u5e94\u5bf9\u63a7\u5236\u53f0\u8c03\u8bd5\u5e26\u6765\u7684\u9690\u60a3\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173131138385139.jpg\" class=\"aligncenter\" title=\"\u7981\u6b62\u6d4f\u89c8\u5668\u9690\u85cf\u5143\u7d20\u8bbe\u7f6e\u9632\u6b62\u7528\u6237\u7be1\u6539\u7f51\u9875\u65f6\uff0c\u5982\u4f55\u5e94\u5bf9\u63a7\u5236\u53f0\u8c03\u8bd5\u5e26\u6765\u7684\u9690\u60a3\uff1f\u63d2\u56fe\" alt=\"\u7981\u6b62\u6d4f\u89c8\u5668\u9690\u85cf\u5143\u7d20\u8bbe\u7f6e\u9632\u6b62\u7528\u6237\u7be1\u6539\u7f51\u9875\u65f6\uff0c\u5982\u4f55\u5e94\u5bf9\u63a7\u5236\u53f0\u8c03\u8bd5\u5e26\u6765\u7684\u9690\u60a3\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u7981\u6b62\u6d4f\u89c8\u5668\u9690\u85cf\u5143\u7d20\u8bbe\u7f6e<\/strong><\/p>\n<p>\u9632\u6b62\u7528\u6237\u7be1\u6539\u7f51\u9875\u65f6\uff0c\u6d4f\u89c8\u5668\u9690\u85cf\u5143\u7d20\u529f\u80fd\u53ef\u80fd\u6210\u4e3a\u9690\u60a3\u3002\u5982\u4f55\u5e94\u5bf9\u8fd9\u4e00\u6311\u6218\uff1f<\/p>\n<p><strong>\u89e3\u51b3\u65b9\u6848<\/strong><\/p>\n<p>\u9996\u5148\uff0c\u53ef\u4ee5\u901a\u8fc7\u7981\u6b62\u6253\u5f00\u63a7\u5236\u53f0\uff0c\u9632\u6b62\u7528\u6237\u8fdb\u884c\u4ee3\u7801\u8c03\u8bd5\uff1a<\/p>\n<p><strong>\u65b9\u6848 1<\/strong><\/p>\n<p>\u7981\u6b62\u53f3\u952e\u67e5\u770b\u6e90\u7801\u548c F12\uff1a<\/p>\n<pre>\/\/ \u7981\u6b62 F12 \u952e\u76d8\u4e8b\u4ef6\ndocument.addEventListener('keydown', function(event){\n  return 123 != event.keyCode || (event.returnValue = false)\n});\n\n\/\/ \u7981\u6b62\u53f3\u952e\u3001\u9009\u62e9\u3001\u590d\u5236\ndocument.addEventListener(\u2018'contextmenu'\u2019, function(event){\n  return event.returnValue = false\n})<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p><strong>\u65b9\u6848 2<\/strong><\/p>\n<p>\u901a\u8fc7\u9875\u9762\u5bbd\u5ea6\u53d8\u5316\u76d1\u6d4b\u63a7\u5236\u53f0\uff1a<\/p>\n<p>\u76d1\u6d4b\u53ef\u89c6\u533a\u57df\u5bbd\u9ad8\u548c\u6d4f\u89c8\u5668\u5bbd\u9ad8\u7684\u5dee\u503c\uff0c\u5982\u679c\u8d85\u8fc7\u8bbe\u5b9a\u7684\u9608\u503c\uff0c\u5219\u5224\u65ad\u63a7\u5236\u53f0\u5df2\u6253\u5f00\u3002<\/p>\n<pre>function resize(){\n  var threshold = 200;\n  var widthThreshold = window.outerWidth - window.innerWidth &gt; threshold;\n  var heightThreshold = window.outerHeight - window.innerHeight &gt; threshold;\n  if(widthThreshold || heightThreshold){\n    console.log('\u63a7\u5236\u53f0\u6253\u5f00\u4e86')\n  }\n}\nwindow.addEventListener('resize', resize);\nresize()<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p><strong>\u65b9\u6848 3<\/strong><\/p>\n<p>\u5229\u7528 debugger \u7279\u6027\uff0c\u65e0\u9650\u9012\u5f52\uff1a<\/p>\n<p>\u5982\u679c\u6ca1\u6709\u8c03\u8bd5\u529f\u80fd\u53ef\u7528\uff0cdebugger \u8bed\u53e5\u5c06\u4e0d\u8d77\u4f5c\u7528\u3002\u5229\u7528\u8fd9\u4e2a\u7279\u6027\uff0c\u53ef\u4ee5\u963b\u6b62\u4ee3\u7801\u6267\u884c\uff1a<\/p>\n<pre>function check() {\n  function doCheck(a) {\n    (function() {}[\"constructor\"](\"debugger\")()); \/\/debugger\n    doCheck(++a);\n  }\n  try {\n    doCheck(0)\n  } catch(err) {\n    console.log(err)\n  }\n};<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u6700\u540e\uff0c\u5c06\u7f51\u9875\u6574\u4f53\u8f6c\u6362\u6210\u56fe\u7247\u4e5f\u662f\u4e00\u79cd\u9009\u62e9\uff0c\u7528\u6237\u65e0\u6cd5\u5355\u72ec\u53bb\u9664\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u7981\u6b62\u6d4f\u89c8\u5668\u9690\u85cf\u5143\u7d20\u8bbe\u7f6e\u9632\u6b62\u7528\u6237\u7be1\u6539\u7f51\u9875\u65f6\uff0c\u5982\u4f55\u5e94\u5bf9\u63a7\u5236\u53f0\u8c03\u8bd5\u5e26\u6765\u7684\u9690\u60a3\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7981\u6b62\u6d4f\u89c8\u5668\u9690\u85cf\u5143\u7d20\u8bbe\u7f6e \u9632\u6b62\u7528\u6237\u7be1\u6539\u7f51\u9875\u65f6\uff0c\u6d4f\u89c8\u5668\u9690\u85cf\u5143\u7d20\u529f\u80fd\u53ef\u80fd\u6210\u4e3a\u9690\u60a3\u3002\u5982\u4f55\u5e94\u5bf9\u8fd9\u4e00\u6311\u6218\uff1f \u89e3\u51b3\u65b9\u6848 \u9996\u5148\uff0c\u53ef\u4ee5\u901a\u8fc7\u7981\u6b62\u6253\u5f00\u63a7\u5236\u53f0\uff0c\u9632\u6b62\u7528\u6237\u8fdb\u884c\u4ee3\u7801\u8c03\u8bd5\uff1a \u65b9\u6848 1 \u7981\u6b62\u53f3\u952e\u67e5\u770b\u6e90\u7801\u548c F12\uff1a \/\/ \u7981\u6b62 F12 \u952e\u76d8\u4e8b\u4ef6 document.addEventListener(&#8216;keydown&#8217;, function(event){ return 123 != event.keyCode || (event.returnValue = false) }); \/\/ \u7981\u6b62\u53f3\u952e\u3001\u9009\u62e9\u3001\u590d\u5236 document.addEventListener(\u2018&#8217;contextmenu&#8217;\u2019, function(event){ return event.returnValue = false }) \u767b\u5f55\u540e\u590d\u5236 \u65b9\u6848 2 \u901a\u8fc7\u9875\u9762\u5bbd\u5ea6\u53d8\u5316\u76d1\u6d4b\u63a7\u5236\u53f0\uff1a \u76d1\u6d4b\u53ef\u89c6\u533a\u57df\u5bbd\u9ad8\u548c\u6d4f\u89c8\u5668\u5bbd\u9ad8\u7684\u5dee\u503c\uff0c\u5982\u679c\u8d85\u8fc7\u8bbe\u5b9a\u7684\u9608\u503c\uff0c\u5219\u5224\u65ad\u63a7\u5236\u53f0\u5df2\u6253\u5f00\u3002 function resize(){ var threshold = 200; var widthThreshold = window.outerWidth &#8211; window.innerWidth &gt; threshold; var heightThreshold = window.outerHeight [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-27749","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/27749","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=27749"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/27749\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=27749"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=27749"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=27749"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}