{"id":53411,"date":"2024-12-03T17:35:59","date_gmt":"2024-12-03T09:35:59","guid":{"rendered":"https:\/\/fwq.ai\/blog\/53411\/"},"modified":"2024-12-03T17:35:59","modified_gmt":"2024-12-03T09:35:59","slug":"%e5%a6%82%e4%bd%95%e9%98%b2%e6%ad%a2%e7%94%a8%e6%88%b7%e4%bd%bf%e7%94%a8%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%e6%9d%a5%e5%8e%bb%e9%99%a4%e7%bd%91%e9%a1%b5","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/53411\/","title":{"rendered":"\u5982\u4f55\u9632\u6b62\u7528\u6237\u4f7f\u7528\u6d4f\u89c8\u5668\u9690\u85cf\u5143\u7d20\u8bbe\u7f6e\u6765\u53bb\u9664\u7f51\u9875\u6c34\u5370\uff1f"},"content":{"rendered":"<p><b><\/b>     <\/p>\n<h1>\u5982\u4f55\u9632\u6b62\u7528\u6237\u4f7f\u7528\u6d4f\u89c8\u5668\u9690\u85cf\u5143\u7d20\u8bbe\u7f6e\u6765\u53bb\u9664\u7f51\u9875\u6c34\u5370\uff1f<\/h1>\n<p>\u6765\u5230\u7c73\u4e91\u7684\u5927\u5bb6\uff0c\u76f8\u4fe1\u90fd\u662f\u7f16\u7a0b\u5b66\u4e60\u7231\u597d\u8005\uff0c\u5e0c\u671b\u5728\u8fd9\u91cc\u5b66\u4e60\u6587\u7ae0\u76f8\u5173\u7f16\u7a0b\u77e5\u8bc6\u3002\u4e0b\u9762\u672c\u7bc7\u6587\u7ae0\u5c31\u6765\u5e26\u5927\u5bb6\u804a\u804a\u300a\u5982\u4f55\u9632\u6b62\u7528\u6237\u4f7f\u7528\u6d4f\u89c8\u5668\u9690\u85cf\u5143\u7d20\u8bbe\u7f6e\u6765\u53bb\u9664\u7f51\u9875\u6c34\u5370\uff1f\u300b\uff0c\u4ecb\u7ecd\u4e00\u4e0b\uff0c\u5e0c\u671b\u5bf9\u5927\u5bb6\u7684\u77e5\u8bc6\u79ef\u7d2f\u6709\u6240\u5e2e\u52a9\uff0c\u52a9\u529b\u5b9e\u6218\u5f00\u53d1\uff01<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241130\/1732932946674a75522b589.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u9632\u6b62\u7528\u6237\u4f7f\u7528\u6d4f\u89c8\u5668\u9690\u85cf\u5143\u7d20\u8bbe\u7f6e\u6765\u53bb\u9664\u7f51\u9875\u6c34\u5370\uff1f\u63d2\u56fe\" alt=\"\u5982\u4f55\u9632\u6b62\u7528\u6237\u4f7f\u7528\u6d4f\u89c8\u5668\u9690\u85cf\u5143\u7d20\u8bbe\u7f6e\u6765\u53bb\u9664\u7f51\u9875\u6c34\u5370\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u9632\u6b62\u7528\u6237\u4f7f\u7528\u6d4f\u89c8\u5668\u9690\u85cf\u5143\u7d20\u8bbe\u7f6e\uff1f<\/strong><\/p>\n<p>\u5728\u7f51\u9875\u6c34\u5370\u4e2d\uff0c\u4e3a\u4e86\u9632\u6b62\u7528\u6237\u7be1\u6539\uff0c\u9700\u8981\u7981\u6b62\u6d4f\u89c8\u5668\u63d0\u4f9b\u7684\u9690\u85cf\u5143\u7d20\u9009\u9879\u3002\u4e0b\u9762\u4ecb\u7ecd\u51e0\u79cd\u89e3\u51b3\u65b9\u6848\uff1a<\/p>\n<p><strong>1. \u7981\u6b62\u53f3\u952e\u67e5\u770b\u6e90\u7801\u548c f12<\/strong><\/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('contextmenu', function(event){\n  return event.returnvalue = false\n})<\/pre>\n<p><strong>2. \u901a\u8fc7\u9875\u9762\u5bbd\u5ea6\u53d8\u5316\u68c0\u6d4b\u63a7\u5236\u53f0<\/strong><\/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><strong>3. \u5229\u7528 debugger \u7684\u7279\u6027\uff0c\u65e0\u9650\u9012\u5f52<\/strong><\/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><strong>\u5176\u4ed6\u5efa\u8bae<\/strong><\/p>\n<ul>\n<li>\u5c06\u6574\u4f53\u8f6c\u6362\u6210\u56fe\u7247\uff0c\u907f\u514d\u7528\u6237\u5355\u72ec\u53bb\u6389\u6c34\u5370\u3002<\/li>\n<li>\u6301\u7eed\u5173\u6ce8\u6d4f\u89c8\u5668\u7684\u66f4\u65b0\uff0c\u53ca\u65f6\u91c7\u53d6\u9488\u5bf9\u6027\u7684\u63aa\u65bd\u3002<\/li>\n<\/ul>\n<p>\u5230\u8fd9\u91cc\uff0c\u6211\u4eec\u4e5f\u5c31\u8bb2\u5b8c\u4e86\u300a\u5982\u4f55\u9632\u6b62\u7528\u6237\u4f7f\u7528\u6d4f\u89c8\u5668\u9690\u85cf\u5143\u7d20\u8bbe\u7f6e\u6765\u53bb\u9664\u7f51\u9875\u6c34\u5370\uff1f\u300b\u7684\u5185\u5bb9\u4e86\u3002\u4e2a\u4eba\u8ba4\u4e3a\uff0c\u57fa\u7840\u77e5\u8bc6\u7684\u5b66\u4e60\u548c\u5de9\u56fa\uff0c\u662f\u4e3a\u4e86\u66f4\u597d\u7684\u5c06\u5176\u8fd0\u7528\u5230\u9879\u76ee\u4e2d\uff0c\u6b22\u8fce\u5173\u6ce8\u7c73\u4e91\u516c\u4f17\u53f7\uff0c\u5e26\u4f60\u4e86\u89e3\u66f4\u591a\u5173\u4e8e\u7684\u77e5\u8bc6\u70b9\uff01<\/p>\n<dl>\n<dt><\/dt>\n<dd>\n   \u5982\u4f55\u4f7f\u9f20\u6807\u6eda\u8f6e\u9ed8\u8ba4\u6a2a\u5411\u6eda\u52a8\u6c34\u5e73\u5217\u8868\uff1f\n <\/dd>\n<\/dl>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u9632\u6b62\u7528\u6237\u4f7f\u7528\u6d4f\u89c8\u5668\u9690\u85cf\u5143\u7d20\u8bbe\u7f6e\u6765\u53bb\u9664\u7f51\u9875\u6c34\u5370\uff1f \u6765\u5230\u7c73\u4e91\u7684\u5927\u5bb6\uff0c\u76f8\u4fe1\u90fd\u662f\u7f16\u7a0b\u5b66\u4e60\u7231\u597d\u8005\uff0c\u5e0c\u671b\u5728\u8fd9\u91cc\u5b66\u4e60\u6587\u7ae0\u76f8\u5173\u7f16\u7a0b\u77e5\u8bc6\u3002\u4e0b\u9762\u672c\u7bc7\u6587\u7ae0\u5c31\u6765\u5e26\u5927\u5bb6\u804a\u804a\u300a\u5982\u4f55\u9632\u6b62\u7528\u6237\u4f7f\u7528\u6d4f\u89c8\u5668\u9690\u85cf\u5143\u7d20\u8bbe\u7f6e\u6765\u53bb\u9664\u7f51\u9875\u6c34\u5370\uff1f\u300b\uff0c\u4ecb\u7ecd\u4e00\u4e0b\uff0c\u5e0c\u671b\u5bf9\u5927\u5bb6\u7684\u77e5\u8bc6\u79ef\u7d2f\u6709\u6240\u5e2e\u52a9\uff0c\u52a9\u529b\u5b9e\u6218\u5f00\u53d1\uff01 \u5982\u4f55\u9632\u6b62\u7528\u6237\u4f7f\u7528\u6d4f\u89c8\u5668\u9690\u85cf\u5143\u7d20\u8bbe\u7f6e\uff1f \u5728\u7f51\u9875\u6c34\u5370\u4e2d\uff0c\u4e3a\u4e86\u9632\u6b62\u7528\u6237\u7be1\u6539\uff0c\u9700\u8981\u7981\u6b62\u6d4f\u89c8\u5668\u63d0\u4f9b\u7684\u9690\u85cf\u5143\u7d20\u9009\u9879\u3002\u4e0b\u9762\u4ecb\u7ecd\u51e0\u79cd\u89e3\u51b3\u65b9\u6848\uff1a 1. \u7981\u6b62\u53f3\u952e\u67e5\u770b\u6e90\u7801\u548c f12 \/\/\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(&#8216;contextmenu&#8217;, function(event){ return event.returnvalue = false }) 2. \u901a\u8fc7\u9875\u9762\u5bbd\u5ea6\u53d8\u5316\u68c0\u6d4b\u63a7\u5236\u53f0 function resize(){ var threshold = 200; var widththreshold = window.outerwidth &#8211; window.innerwidth &gt; threshold; var heightthreshold = window.outerheight &#8211; window.innerheight &gt; threshold; if(widththreshold || [&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-53411","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/53411","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=53411"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/53411\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=53411"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=53411"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=53411"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}