{"id":2031,"date":"2025-06-10T20:11:30","date_gmt":"2025-06-10T12:11:30","guid":{"rendered":"https:\/\/www.zhaozhao123.cn\/wpcms\/wpdt\/2031.html"},"modified":"2025-06-10T20:11:30","modified_gmt":"2025-06-10T12:11:30","slug":"google-lighthouse%e6%98%af%e4%bb%80%e4%b9%88%ef%bc%9f%e5%ae%83%e5%a6%82%e4%bd%95%e6%94%b9%e5%96%84%e6%82%a8%e7%9a%84%e7%bd%91%e7%ab%99%e7%94%a8%e6%88%b7%e4%bd%93%e9%aa%8c%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/www.zhaozhao123.cn\/wpcms\/post\/2031.html","title":{"rendered":"Google Lighthouse\u662f\u4ec0\u4e48\uff1f\u5b83\u5982\u4f55\u6539\u5584\u60a8\u7684\u7f51\u7ad9\u7528\u6237\u4f53\u9a8c\uff1f"},"content":{"rendered":"<div class=\"wp-block-columns p-0 border is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\r\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\r\n<div class=\"wp-block-columns px-4 py-3 border-bottom has-background is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\" style=\"background:linear-gradient(243deg,rgb(238,238,238) 0%,rgba(58,166,242,0.15) 100%)\">\r\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\r\n<div class=\"wp-block-group is-nowrap is-layout-flex wp-container-core-group-is-layout-6c531013 wp-block-group-is-layout-flex\">\r\n<figure class=\"wp-block-image size-thumbnail is-resized is-style-rounded is-style-rounded--1\"><img decoding=\"async\" src=\"https:\/\/www.zhaozhao123.cn\/myitems\/images\/sites16\/2025\/06\/dyA-1-400x300.jpg\" alt=\"Bug&#32534;&#35793;&#29422;\" class=\"wp-image-1842\" style=\"object-fit:cover;width:30px;height:30px\"><\/figure>\r\n\r\n\r\n\r\n<p class=\"my-0\">Bug&#32534;&#35793;&#29422;<\/p>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n\r\n\r\n\r\n<div class=\"wp-block-columns px-xl-5 px-4 py-xl-4 py-3 is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\r\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\r\n<p><strong>Google Lighthouse: &#20102;&#35299;&#20854;&#21151;&#33021;&#21644;&#22914;&#20309;&#25913;&#36827;&#32593;&#31449;&#20307;&#39564;<\/strong><\/p>\n<p><strong>Google Lighthouse &#26159;&#20160;&#20040;&#65311;<\/strong><\/p>\n<p>Google Lighthouse &#26159; Google &#25552;&#20379;&#30340;&#19968;&#20010;&#24037;&#20855;&#65292;&#26088;&#22312;&#24110;&#21161;&#24320;&#21457;&#32773;&#35780;&#20272;&#20182;&#20204;&#30340;&#32593;&#31449;&#24615;&#33021;&#12289;SEO &#21644;&#21487;&#29992;&#24615;&#12290;&#23427;&#25552;&#20379;&#20102;&#35814;&#32454;&#30340;&#25253;&#21578;&#65292;&#24110;&#21161;&#24744;&#35782;&#21035;&#21487;&#20197;&#20248;&#21270;&#30340;&#39046;&#22495;&#12290;<\/p>\n<p><strong>&#22914;&#20309;&#36890;&#36807; Google Lighthouse &#25913;&#21892;&#24744;&#30340;&#32593;&#31449;&#29992;&#25143;&#20307;&#39564;&#65311;<\/strong><\/p>\n<ol>\n<li><strong>&#24615;&#33021;&#20998;&#26512;<\/strong>: Lighthouse &#21487;&#20197;&#25552;&#20379;&#26377;&#20851;&#39029;&#38754;&#21152;&#36733;&#26102;&#38388;&#12289;&#36164;&#28304;&#22823;&#23567;&#21644;&#32531;&#23384;&#31574;&#30053;&#31561;&#20851;&#38190;&#25351;&#26631;&#30340;&#25968;&#25454;&#12290;&#36890;&#36807;&#25552;&#39640;&#36825;&#20123;&#26041;&#38754;&#30340;&#34920;&#29616;&#65292;&#24744;&#21487;&#20197;&#30830;&#20445;&#24744;&#30340;&#32593;&#31449;&#24555;&#36895;&#21709;&#24212;&#29992;&#25143;&#38656;&#27714;&#12290;<\/li>\n<li><strong>SEO &#20248;&#21270;<\/strong>: Lighthouse &#36824;&#21487;&#20197;&#24110;&#21161;&#24744;&#21457;&#29616; SEO &#38656;&#35201;&#25913;&#36827;&#30340;&#22320;&#26041;&#65292;&#22914;&#20803;&#26631;&#31614;&#12289;&#26631;&#39064;&#21644;&#25551;&#36848;&#12290;&#36825;&#26377;&#21161;&#20110;&#25552;&#39640;&#25628;&#32034;&#24341;&#25806;&#25490;&#21517;&#24182;&#21560;&#24341;&#26356;&#22810;&#27969;&#37327;&#12290;<\/li>\n<li><strong>&#26080;&#38556;&#30861;&#24615;&#26816;&#26597;<\/strong>: Lighthouse &#33021;&#22815;&#26816;&#27979;&#39029;&#38754;&#26159;&#21542;&#31526;&#21512; Web Content Accessibility Guidelines (WCAG) &#30340;&#26631;&#20934;&#65292;&#30830;&#20445;&#25152;&#26377;&#29992;&#25143;&#37117;&#33021;&#35775;&#38382;&#24744;&#30340;&#32593;&#31449;&#65292;&#21253;&#25324;&#37027;&#20123;&#26377;&#35270;&#35273;&#38556;&#30861;&#25110;&#20854;&#20182;&#24418;&#24335;&#30340;&#38556;&#30861;&#30340;&#20154;&#12290;<\/li>\n<li><strong>&#31227;&#21160;&#31471;&#21451;&#22909;&#24230;<\/strong>: &#23545;&#20110;&#31227;&#21160;&#35774;&#22791;&#21451;&#22909;&#30340;&#32593;&#31449;&#33267;&#20851;&#37325;&#35201;&#12290;Lighthouse &#21487;&#20197;&#24110;&#21161;&#24744;&#35780;&#20272;&#39029;&#38754;&#23545;&#19981;&#21516;&#23631;&#24149;&#23610;&#23544;&#30340;&#25903;&#25345;&#24773;&#20917;&#65292;&#20197;&#21450;&#22914;&#20309;&#20248;&#21270;&#24067;&#23616;&#20197;&#36866;&#24212;&#21508;&#31181;&#35774;&#22791;&#12290;<\/li>\n<li><strong>&#26368;&#20339;&#23454;&#36341;&#25351;&#21335;<\/strong>: Lighthouse &#20250;&#25552;&#20379;&#19968;&#31995;&#21015;&#26368;&#20339;&#23454;&#36341;&#24314;&#35758;&#65292;&#24110;&#21161;&#24744;&#26681;&#25454;&#33258;&#24049;&#30340;&#32593;&#31449;&#29305;&#28857;&#36827;&#34892;&#35843;&#25972;&#21644;&#20248;&#21270;&#12290;<\/li>\n<\/ol>\n<p><strong>&#31034;&#20363;&#20195;&#30721;<\/strong><\/p>\n<pre><code class=\"language-html\">&lt;!DOCTYPE html&gt;\n&lt;html lang=\"en\"&gt;\n&lt;head&gt;\n    &lt;meta charset=\"UTF-8\"&gt;\n    &lt;title&gt;My Website&lt;\/title&gt;\n    &lt;!-- &#24341;&#20837; Google Lighthouse &#26679;&#24335;&#34920; --&gt;\n    &lt;link rel=\"stylesheet\" href=\"https:\/\/cdn.jsdelivr.net\/npm\/@lighthousejs\/lighthouse@latest\/dist\/styles\/lh.css\"&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n    &lt;div id=\"lh-container\"&gt;&lt;\/div&gt;\n    &lt;script src=\"https:\/\/cdn.jsdelivr.net\/npm\/@lighthousejs\/lighthouse@latest\/dist\/scripts\/lh.js\"&gt;&lt;\/script&gt;\n    &lt;script&gt;\n        \/\/ &#21021;&#22987;&#21270; Lighthouse &#27979;&#35797;\n        LH.init({\n            configUrl: 'https:\/\/yourwebsite.com\/config.json',\n            reportUrl: 'https:\/\/yourwebsite.com\/report.html'\n        });\n\n        \/\/ &#25191;&#34892;&#27979;&#35797;\n        LH.run();\n    &lt;\/script&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;<\/code><\/pre>\n<p><strong>&#20351;&#29992;&#27493;&#39588;&#21450;&#25928;&#26524;<\/strong><\/p>\n<ol>\n<li>&#22312;&#26412;&#22320;&#25110;&#25176;&#31649;&#26381;&#21153;&#22120;&#19978;&#25171;&#24320; HTML &#25991;&#20214;&#12290;<\/li>\n<li>&#20351;&#29992;&#27983;&#35272;&#22120;&#25193;&#23637;&#65288;&#22914; Google Chrome DevTools&#65289;&#26597;&#30475; Lighthouse &#25253;&#21578;&#12290;<\/li>\n<li>&#26816;&#26597;&#25253;&#21578;&#20013;&#30340;&#21508;&#39033;&#25351;&#26631;&#65292;&#22914;&#39029;&#38754;&#21152;&#36733;&#36895;&#24230;&#12289;&#36164;&#28304;&#22823;&#23567;&#12289;DOM &#20803;&#32032;&#25968;&#37327;&#31561;&#12290;<\/li>\n<li>&#26681;&#25454;&#25253;&#21578;&#20013;&#30340;&#24314;&#35758;&#36827;&#34892;&#30456;&#24212;&#30340;&#20248;&#21270;&#25805;&#20316;&#12290;<\/li>\n<li>&#37325;&#22797;&#19978;&#36848;&#27493;&#39588;&#65292;&#30452;&#21040;&#28385;&#36275;&#26368;&#20339;&#23454;&#36341;&#26631;&#20934;&#12290;<\/li>\n<\/ol>\n<p>&#36890;&#36807;&#20197;&#19978;&#27493;&#39588;&#65292;&#24744;&#21487;&#20197;&#21033;&#29992; Google Lighthouse &#26469;&#20840;&#38754;&#35780;&#20272;&#21644;&#20248;&#21270;&#24744;&#30340;&#32593;&#31449;&#65292;&#20174;&#32780;&#25552;&#21319;&#29992;&#25143;&#20307;&#39564;&#21644;&#25628;&#32034;&#24341;&#25806;&#25490;&#21517;&#12290;<\/p>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n<\/div><div class=\"wp-block-columns p-0 border is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\r\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\r\n<div class=\"wp-block-columns px-4 py-3 border-bottom has-background is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\" style=\"background:linear-gradient(243deg,rgb(238,238,238) 0%,rgba(58,166,242,0.15) 100%)\">\r\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\r\n<div class=\"wp-block-group is-nowrap is-layout-flex wp-container-core-group-is-layout-6c531013 wp-block-group-is-layout-flex\">\r\n<figure class=\"wp-block-image size-thumbnail is-resized is-style-rounded is-style-rounded--2\"><img decoding=\"async\" src=\"https:\/\/www.zhaozhao123.cn\/myitems\/images\/sites16\/2025\/06\/zp-400x300.jpg\" alt=\"&#40657;&#26495;&#21069;&#30340;Bug&#35821;&#27861;&#35762;&#24072;\" class=\"wp-image-1849\" style=\"object-fit:cover;width:30px;height:30px\"><\/figure>\r\n\r\n\r\n\r\n<p class=\"my-0\">&#40657;&#26495;&#21069;&#30340;Bug&#35821;&#27861;&#35762;&#24072;<\/p>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n\r\n\r\n\r\n<div class=\"wp-block-columns px-xl-5 px-4 py-xl-4 py-3 is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\r\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\r\n<p>Google Lighthouse &#26159; Google &#24320;&#21457;&#30340;&#19968;&#20010;&#24037;&#20855;&#65292;&#29992;&#20110;&#35780;&#20272;&#32593;&#31449;&#24615;&#33021;&#21644;&#21487;&#29992;&#24615;&#12290;&#23427;&#30340;&#30446;&#26631;&#26159;&#25552;&#20379;&#19968;&#20010;&#32479;&#19968;&#30340;&#12289;&#19968;&#33268;&#30340;&#25351;&#26631;&#26469;&#34913;&#37327;&#32593;&#39029;&#30340;&#34920;&#29616;&#12290;&#36890;&#36807;&#20998;&#26512;&#32593;&#39029;&#30340;&#36895;&#24230;&#12289;&#21152;&#36733;&#26102;&#38388;&#12289;&#21709;&#24212;&#26102;&#38388;&#21644;&#38169;&#35823;&#20449;&#24687;&#31561;&#65292;Lighthouse &#21487;&#20197;&#24110;&#21161;&#24320;&#21457;&#32773;&#20248;&#21270;&#20854;&#32593;&#31449;&#65292;&#25552;&#39640;&#29992;&#25143;&#20307;&#39564;&#12290;<\/p>\n<h3>&#22914;&#20309;&#20351;&#29992; Google Lighthouse<\/h3>\n<ol>\n<li>\n<p><strong>&#23433;&#35013;&#24182;&#37197;&#32622;<\/strong>&#65306;<\/p>\n<ul>\n<li>&#22312;&#21629;&#20196;&#34892;&#25110;&#32456;&#31471;&#20013;&#36816;&#34892;&#20197;&#19979;&#21629;&#20196;&#26469;&#23433;&#35013; Google Lighthouse CLI&#65288;&#21629;&#20196;&#34892;&#30028;&#38754;&#65289;&#65306;<code>npm install -g google-lighthouse-cli<\/code><\/li>\n<li>&#23433;&#35013;&#23436;&#25104;&#21518;&#65292;&#21487;&#20197;&#36816;&#34892; <code>google-lighthouse --help<\/code> &#26469;&#26597;&#30475;&#21487;&#29992;&#30340;&#21629;&#20196;&#12290;<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>&#21019;&#24314;&#25253;&#21578;<\/strong>&#65306;<\/p>\n<ul>\n<li>&#20351;&#29992; <code>google-lighthouse<\/code> &#21629;&#20196;&#21019;&#24314;&#25253;&#21578;&#12290;\n<pre><code class=\"language-bash\">google-lighthouse [options] [path]<\/code><\/pre>\n<p>&#20363;&#22914;&#65292;&#35201;&#26816;&#26597;&#26576;&#20010;&#29305;&#23450;&#39029;&#38754;&#65292;&#35831;&#25191;&#34892;&#20197;&#19979;&#21629;&#20196;&#65306;<\/p>\n<pre><code class=\"language-bash\">google-lighthouse --load-time-only https:\/\/example.com\/page.html<\/code><\/pre><\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>&#35299;&#26512;&#25253;&#21578;<\/strong>&#65306;<\/p>\n<ul>\n<li>&#20351;&#29992; <code>google-lighthouse-report<\/code> &#21629;&#20196;&#35299;&#26512;&#25253;&#21578;&#12290;\n<pre><code class=\"language-bash\">google-lighthouse-report https:\/\/example.com\/<\/code><\/pre><\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>&#23548;&#20986;&#25253;&#21578;<\/strong>&#65306;<\/p>\n<ul>\n<li>&#23558;&#25253;&#21578;&#23548;&#20986;&#20026; HTML&#12289;CSV &#25110; JSON &#26684;&#24335;&#12290;\n<pre><code class=\"language-bash\">google-lighthouse-report -o https:\/\/example.com\/lighthouse.json<\/code><\/pre><\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>&#35299;&#37322;&#25253;&#21578;&#32467;&#26524;<\/strong>&#65306;<\/p>\n<ul>\n<li>&#20998;&#26512;&#25253;&#21578;&#20013;&#30340;&#21508;&#20010;&#37096;&#20998;&#65292;&#22914;&#36895;&#24230;&#12289;&#21152;&#36733;&#26102;&#38388;&#12289;&#21709;&#24212;&#26102;&#38388;&#21644;&#38169;&#35823;&#20449;&#24687;&#65292;&#20197;&#20102;&#35299;&#32593;&#31449;&#34920;&#29616;&#12290;<\/li>\n<li>&#38024;&#23545;&#21457;&#29616;&#30340;&#38382;&#39064;&#37319;&#21462;&#34892;&#21160;&#65292;&#20248;&#21270;&#32593;&#31449;&#24615;&#33021;&#12290;<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h3>&#25913;&#21892;&#32593;&#31449;&#20307;&#39564;&#30340;&#20851;&#38190;&#28857;<\/h3>\n<ul>\n<li><strong>&#20943;&#23569;&#21152;&#36733;&#26102;&#38388;<\/strong>&#65306;&#20248;&#21270;&#22270;&#29255;&#22823;&#23567;&#12289;&#21387;&#32553;CSS&#21644;JavaScript&#25991;&#20214;&#65292;&#20197;&#21450;&#20943;&#23569;HTTP&#35831;&#27714;&#30340;&#25968;&#37327;&#12290;<\/li>\n<li><strong>&#25552;&#39640;&#21152;&#36733;&#36895;&#24230;<\/strong>&#65306;&#20248;&#21270;&#20195;&#30721;&#32467;&#26500;&#65292;&#20943;&#23569;&#19981;&#24517;&#35201;&#30340;&#33050;&#26412;&#21644;DOM&#25805;&#20316;&#65292;&#20351;&#29992;CDN&#21152;&#36895;&#36164;&#28304;&#21152;&#36733;&#12290;<\/li>\n<li><strong>&#31616;&#21270;&#32467;&#26500;&#21644;&#24067;&#23616;<\/strong>&#65306;&#20943;&#23569;&#20887;&#20313;&#20803;&#32032;&#21644;&#26679;&#24335;&#65292;&#30830;&#20445;&#29992;&#25143;&#30028;&#38754;&#31616;&#27905;&#26131;&#29992;&#12290;<\/li>\n<li><strong>&#21709;&#24212;&#24335;&#35774;&#35745;<\/strong>&#65306;&#30830;&#20445;&#32593;&#31449;&#22312;&#19981;&#21516;&#35774;&#22791;&#21644;&#23631;&#24149;&#23610;&#23544;&#19978;&#37117;&#33021;&#33391;&#22909;&#26174;&#31034;&#12290;<\/li>\n<li><strong>&#23433;&#20840;&#24615;<\/strong>&#65306;&#30830;&#20445;&#32593;&#31449;&#30340;&#23433;&#20840;&#24615;&#21644;&#31283;&#23450;&#24615;&#65292;&#21253;&#25324;&#38450;&#27490;&#36328;&#31449;&#33050;&#26412;&#25915;&#20987;&#65288;XSS&#65289;&#12289;SQL&#27880;&#20837;&#21644;&#20854;&#20182;&#24120;&#35265;&#30340;&#23433;&#20840;&#28431;&#27934;&#12290;<\/li>\n<li><strong>SEO&#20248;&#21270;<\/strong>&#65306;&#21033;&#29992;&#20851;&#38190;&#35789;&#23494;&#24230;&#12289;&#20803;&#26631;&#31614;&#21644;&#25628;&#32034;&#24341;&#25806;&#21451;&#22909;&#30340;&#38142;&#25509;&#32467;&#26500;&#26469;&#25552;&#21319;&#25628;&#32034;&#24341;&#25806;&#21487;&#35265;&#24230;&#12290;<\/li>\n<\/ul>\n<p>&#36890;&#36807;&#25345;&#32493;&#30417;&#25511;&#21644;&#20248;&#21270;&#36825;&#20123;&#20851;&#38190;&#26041;&#38754;&#65292;&#24744;&#21487;&#20197;&#26174;&#33879;&#25552;&#39640;&#32593;&#31449;&#30340;&#29992;&#25143;&#20307;&#39564;&#21644;&#25490;&#21517;&#12290;<\/p>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Bug&#32534;&#35793;&#29422; Google Lighthouse: &#20102;&#35299;&#20854;&#21151;&#33021;&#21644;&#22914;&#20309;&#25913;&#36827;&#32593;&#31449;&#20307;&#39564; ..<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[59],"tuisongtax":[],"class_list":["post-2031","post","type-post","status-publish","format-standard","hentry","category-wpdt","tag-pzjc"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/posts\/2031","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/comments?post=2031"}],"version-history":[{"count":0,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/posts\/2031\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/media?parent=2031"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/categories?post=2031"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/tags?post=2031"},{"taxonomy":"tuisongtax","embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/tuisongtax?post=2031"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}