{"id":276,"date":"2026-03-21T22:47:25","date_gmt":"2026-03-21T14:47:25","guid":{"rendered":"https:\/\/pa.yingzhi8.cn\/index.php\/2026\/03\/21\/tools-browser\/"},"modified":"2026-03-21T23:08:57","modified_gmt":"2026-03-21T15:08:57","slug":"tools-browser","status":"publish","type":"post","link":"https:\/\/pa.yingzhi8.cn\/index.php\/2026\/03\/21\/tools-browser\/","title":{"rendered":"\u6d4f\u89c8\u5668\uff08OpenClaw \u6258\u7ba1\uff09"},"content":{"rendered":"<h1>\u6d4f\u89c8\u5668\uff08OpenClaw \u6258\u7ba1\uff09<\/h1>\n<h1>\u6d4f\u89c8\u5668\uff08openclaw \u6258\u7ba1\uff09<\/h1>\n<p>OpenClaw \u53ef\u4ee5\u8fd0\u884c\u4e00\u4e2a\u7531\u667a\u80fd\u4f53\u63a7\u5236\u7684<strong>\u4e13\u7528 Chrome\/Brave\/Edge\/Chromium \u914d\u7f6e\u6587\u4ef6<\/strong>\u3002<br \/>\n\u5b83\u4e0e\u4f60\u7684\u4e2a\u4eba\u6d4f\u89c8\u5668\u9694\u79bb\uff0c\u901a\u8fc7 Gateway \u7f51\u5173\u5185\u90e8\u7684\u5c0f\u578b\u672c\u5730\u63a7\u5236\u670d\u52a1\u8fdb\u884c\u7ba1\u7406\uff08\u4ec5\u9650 loopback\uff09\u3002<\/p>\n<p>\u65b0\u624b\u89c6\u89d2\uff1a<\/p>\n<ul>\n<li>\u628a\u5b83\u60f3\u8c61\u6210\u4e00\u4e2a<strong>\u72ec\u7acb\u7684\u3001\u4ec5\u4f9b\u667a\u80fd\u4f53\u4f7f\u7528\u7684\u6d4f\u89c8\u5668<\/strong>\u3002<\/li>\n<li><code>openclaw<\/code> \u914d\u7f6e\u6587\u4ef6<strong>\u4e0d\u4f1a<\/strong>\u89e6\u53ca\u4f60\u7684\u4e2a\u4eba\u6d4f\u89c8\u5668\u914d\u7f6e\u6587\u4ef6\u3002<\/li>\n<li>\u667a\u80fd\u4f53\u53ef\u4ee5\u5728\u5b89\u5168\u7684\u901a\u9053\u4e2d<strong>\u6253\u5f00\u6807\u7b7e\u9875\u3001\u8bfb\u53d6\u9875\u9762\u3001\u70b9\u51fb\u548c\u8f93\u5165<\/strong>\u3002<\/li>\n<li>\u9ed8\u8ba4\u7684 <code>chrome<\/code> \u914d\u7f6e\u6587\u4ef6\u901a\u8fc7\u6269\u5c55\u4e2d\u7ee7\u4f7f\u7528<strong>\u7cfb\u7edf\u9ed8\u8ba4\u7684 Chromium \u6d4f\u89c8\u5668<\/strong>\uff1b\u5207\u6362\u5230 <code>openclaw<\/code> \u53ef\u4f7f\u7528\u9694\u79bb\u7684\u6258\u7ba1\u6d4f\u89c8\u5668\u3002<\/li>\n<\/ul>\n<h2>\u529f\u80fd\u6982\u89c8<\/h2>\n<ul>\n<li>\u4e00\u4e2a\u540d\u4e3a <strong>openclaw<\/strong> \u7684\u72ec\u7acb\u6d4f\u89c8\u5668\u914d\u7f6e\u6587\u4ef6\uff08\u9ed8\u8ba4\u6a59\u8272\u4e3b\u9898\uff09\u3002<\/li>\n<li>\u786e\u5b9a\u6027\u6807\u7b7e\u9875\u63a7\u5236\uff08\u5217\u51fa\/\u6253\u5f00\/\u805a\u7126\/\u5173\u95ed\uff09\u3002<\/li>\n<li>\u667a\u80fd\u4f53\u64cd\u4f5c\uff08\u70b9\u51fb\/\u8f93\u5165\/\u62d6\u52a8\/\u9009\u62e9\uff09\u3001\u5feb\u7167\u3001\u622a\u56fe\u3001PDF\u3002<\/li>\n<li>\u53ef\u9009\u7684\u591a\u914d\u7f6e\u6587\u4ef6\u652f\u6301\uff08<code>openclaw<\/code>\u3001<code>work<\/code>\u3001<code>remote<\/code> \u7b49\uff09\u3002<\/li>\n<\/ul>\n<p>\u6b64\u6d4f\u89c8\u5668<strong>\u4e0d\u662f<\/strong>\u4f60\u7684\u65e5\u5e38\u6d4f\u89c8\u5668\u3002\u5b83\u662f\u4e00\u4e2a\u5b89\u5168\u3001\u9694\u79bb\u7684\u754c\u9762\uff0c\u7528\u4e8e\u667a\u80fd\u4f53\u81ea\u52a8\u5316\u548c\u9a8c\u8bc1\u3002<\/p>\n<h2>\u5feb\u901f\u5f00\u59cb<\/h2>\n<p>&#8220;`bash  theme={&#8220;theme&#8221;:{&#8220;light&#8221;:&#8221;min-light&#8221;,&#8221;dark&#8221;:&#8221;min-dark&#8221;}}<br \/>\nopenclaw browser &#8211;browser-profile openclaw status<br \/>\nopenclaw browser &#8211;browser-profile openclaw start<br \/>\nopenclaw browser &#8211;browser-profile openclaw open https:\/\/example.com<br \/>\nopenclaw browser &#8211;browser-profile openclaw snapshot<\/p>\n<pre><code>\n\u5982\u679c\u51fa\u73b0&quot;Browser disabled&quot;\uff0c\u8bf7\u5728\u914d\u7f6e\u4e2d\u542f\u7528\u5b83\uff08\u89c1\u4e0b\u6587\uff09\u5e76\u91cd\u542f Gateway \u7f51\u5173\u3002\n\n## \u914d\u7f6e\u6587\u4ef6\uff1a`openclaw` \u4e0e `chrome`\n\n* `openclaw`\uff1a\u6258\u7ba1\u7684\u9694\u79bb\u6d4f\u89c8\u5668\uff08\u65e0\u9700\u6269\u5c55\uff09\u3002\n* `chrome`\uff1a\u5230\u4f60**\u7cfb\u7edf\u6d4f\u89c8\u5668**\u7684\u6269\u5c55\u4e2d\u7ee7\uff08\u9700\u8981\u5c06 OpenClaw \u6269\u5c55\u9644\u52a0\u5230\u6807\u7b7e\u9875\uff09\u3002\n\n\u5982\u679c\u4f60\u5e0c\u671b\u9ed8\u8ba4\u4f7f\u7528\u6258\u7ba1\u6a21\u5f0f\uff0c\u8bf7\u8bbe\u7f6e `browser.defaultProfile: &quot;openclaw&quot;`\u3002\n\n## \u914d\u7f6e\n\n\u6d4f\u89c8\u5668\u8bbe\u7f6e\u4f4d\u4e8e `~\/.openclaw\/openclaw.json`\u3002\n\n```json5  theme={&quot;theme&quot;:{&quot;light&quot;:&quot;min-light&quot;,&quot;dark&quot;:&quot;min-dark&quot;}}\n{\n  browser: {\n    enabled: true, \/\/ default: true\n    \/\/ cdpUrl: &quot;http:\/\/127.0.0.1:18792&quot;, \/\/ legacy single-profile override\n    remoteCdpTimeoutMs: 1500, \/\/ remote CDP HTTP timeout (ms)\n    remoteCdpHandshakeTimeoutMs: 3000, \/\/ remote CDP WebSocket handshake timeout (ms)\n    defaultProfile: &quot;chrome&quot;,\n    color: &quot;#FF4500&quot;,\n    headless: false,\n    noSandbox: false,\n    attachOnly: false,\n    executablePath: &quot;\/Applications\/Brave Browser.app\/Contents\/MacOS\/Brave Browser&quot;,\n    profiles: {\n      openclaw: { cdpPort: 18800, color: &quot;#FF4500&quot; },\n      work: { cdpPort: 18801, color: &quot;#0066CC&quot; },\n      remote: { cdpUrl: &quot;http:\/\/10.0.0.42:9222&quot;, color: &quot;#00AA00&quot; },\n    },\n  },\n}\n<\/code><\/pre>\n<p>\u6ce8\u610f\u4e8b\u9879\uff1a<\/p>\n<ul>\n<li>\u6d4f\u89c8\u5668\u63a7\u5236\u670d\u52a1\u7ed1\u5b9a\u5230 loopback \u4e0a\u7684\u7aef\u53e3\uff0c\u8be5\u7aef\u53e3\u4ece <code>gateway.port<\/code> \u6d3e\u751f\uff08\u9ed8\u8ba4\uff1a<code>18791<\/code>\uff0c\u5373 gateway + 2\uff09\u3002\u4e2d\u7ee7\u4f7f\u7528\u4e0b\u4e00\u4e2a\u7aef\u53e3\uff08<code>18792<\/code>\uff09\u3002<\/li>\n<li>\u5982\u679c\u4f60\u8986\u76d6\u4e86 Gateway \u7f51\u5173\u7aef\u53e3\uff08<code>gateway.port<\/code> \u6216 <code>OPENCLAW_GATEWAY_PORT<\/code>\uff09\uff0c\u6d3e\u751f\u7684\u6d4f\u89c8\u5668\u7aef\u53e3\u4f1a\u76f8\u5e94\u8c03\u6574\u4ee5\u4fdd\u6301\u5728\u540c\u4e00&#8221;\u7cfb\u5217&#8221;\u4e2d\u3002<\/li>\n<li>\u672a\u8bbe\u7f6e\u65f6\uff0c<code>cdpUrl<\/code> \u9ed8\u8ba4\u4e3a\u4e2d\u7ee7\u7aef\u53e3\u3002<\/li>\n<li><code>remoteCdpTimeoutMs<\/code> \u9002\u7528\u4e8e\u8fdc\u7a0b\uff08\u975e loopback\uff09CDP \u53ef\u8fbe\u6027\u68c0\u67e5\u3002<\/li>\n<li><code>remoteCdpHandshakeTimeoutMs<\/code> \u9002\u7528\u4e8e\u8fdc\u7a0b CDP WebSocket \u53ef\u8fbe\u6027\u68c0\u67e5\u3002<\/li>\n<li><code>attachOnly: true<\/code> \u8868\u793a&#8221;\u6c38\u4e0d\u542f\u52a8\u672c\u5730\u6d4f\u89c8\u5668\uff1b\u4ec5\u5728\u6d4f\u89c8\u5668\u5df2\u8fd0\u884c\u65f6\u9644\u52a0&#8221;\u3002<\/li>\n<li><code>color<\/code> + \u6bcf\u4e2a\u914d\u7f6e\u6587\u4ef6\u7684 <code>color<\/code> \u4e3a\u6d4f\u89c8\u5668 UI \u7740\u8272\uff0c\u4ee5\u4fbf\u4f60\u80fd\u770b\u5230\u54ea\u4e2a\u914d\u7f6e\u6587\u4ef6\u5904\u4e8e\u6d3b\u52a8\u72b6\u6001\u3002<\/li>\n<li>\u9ed8\u8ba4\u914d\u7f6e\u6587\u4ef6\u662f <code>chrome<\/code>\uff08\u6269\u5c55\u4e2d\u7ee7\uff09\u3002\u4f7f\u7528 <code>defaultProfile: \"openclaw\"<\/code> \u6765\u4f7f\u7528\u6258\u7ba1\u6d4f\u89c8\u5668\u3002<\/li>\n<li>\u81ea\u52a8\u68c0\u6d4b\u987a\u5e8f\uff1a\u5982\u679c\u7cfb\u7edf\u9ed8\u8ba4\u6d4f\u89c8\u5668\u662f\u57fa\u4e8e Chromium \u7684\u5219\u4f7f\u7528\u5b83\uff1b\u5426\u5219 Chrome \u2192 Brave \u2192 Edge \u2192 Chromium \u2192 Chrome Canary\u3002<\/li>\n<li>\u672c\u5730 <code>openclaw<\/code> \u914d\u7f6e\u6587\u4ef6\u4f1a\u81ea\u52a8\u5206\u914d <code>cdpPort<\/code>\/<code>cdpUrl<\/code> \u2014 \u4ec5\u4e3a\u8fdc\u7a0b CDP \u8bbe\u7f6e\u8fd9\u4e9b\u3002<\/li>\n<\/ul>\n<h2>\u4f7f\u7528 Brave\uff08\u6216\u5176\u4ed6\u57fa\u4e8e Chromium \u7684\u6d4f\u89c8\u5668\uff09<\/h2>\n<p>\u5982\u679c\u4f60\u7684<strong>\u7cfb\u7edf\u9ed8\u8ba4<\/strong>\u6d4f\u89c8\u5668\u662f\u57fa\u4e8e Chromium \u7684\uff08Chrome\/Brave\/Edge \u7b49\uff09\uff0cOpenClaw \u4f1a\u81ea\u52a8\u4f7f\u7528\u5b83\u3002\u8bbe\u7f6e <code>browser.executablePath<\/code> \u53ef\u8986\u76d6\u81ea\u52a8\u68c0\u6d4b\uff1a<\/p>\n<p>CLI \u793a\u4f8b\uff1a<\/p>\n<p>&#8220;`bash  theme={&#8220;theme&#8221;:{&#8220;light&#8221;:&#8221;min-light&#8221;,&#8221;dark&#8221;:&#8221;min-dark&#8221;}}<br \/>\nopenclaw config set browser.executablePath &#8220;\/usr\/bin\/google-chrome&#8221;<\/p>\n<pre><code>\n```json5  theme={&quot;theme&quot;:{&quot;light&quot;:&quot;min-light&quot;,&quot;dark&quot;:&quot;min-dark&quot;}}\n\/\/ macOS\n{\n  browser: {\n    executablePath: &quot;\/Applications\/Brave Browser.app\/Contents\/MacOS\/Brave Browser&quot;\n  }\n}\n\n\/\/ Windows\n{\n  browser: {\n    executablePath: &quot;C:\\Program Files\\BraveSoftware\\Brave-Browser\\Application\\brave.exe&quot;\n  }\n}\n\n\/\/ Linux\n{\n  browser: {\n    executablePath: &quot;\/usr\/bin\/brave-browser&quot;\n  }\n}\n<\/code><\/pre>\n<h2>\u672c\u5730\u63a7\u5236\u4e0e\u8fdc\u7a0b\u63a7\u5236<\/h2>\n<ul>\n<li><strong>\u672c\u5730\u63a7\u5236\uff08\u9ed8\u8ba4\uff09\uff1a<\/strong> Gateway \u7f51\u5173\u542f\u52a8 loopback \u63a7\u5236\u670d\u52a1\uff0c\u53ef\u4ee5\u542f\u52a8\u672c\u5730\u6d4f\u89c8\u5668\u3002<\/li>\n<li><strong>\u8fdc\u7a0b\u63a7\u5236\uff08\u8282\u70b9\u4e3b\u673a\uff09\uff1a<\/strong> \u5728\u6709\u6d4f\u89c8\u5668\u7684\u673a\u5668\u4e0a\u8fd0\u884c\u8282\u70b9\u4e3b\u673a\uff1bGateway \u7f51\u5173\u5c06\u6d4f\u89c8\u5668\u64cd\u4f5c\u4ee3\u7406\u5230\u8be5\u8282\u70b9\u3002<\/li>\n<li><strong>\u8fdc\u7a0b CDP\uff1a<\/strong> \u8bbe\u7f6e <code>browser.profiles.&lt;name&gt;.cdpUrl<\/code>\uff08\u6216 <code>browser.cdpUrl<\/code>\uff09\u4ee5\u9644\u52a0\u5230\u8fdc\u7a0b\u7684\u57fa\u4e8e Chromium \u7684\u6d4f\u89c8\u5668\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0cOpenClaw \u4e0d\u4f1a\u542f\u52a8\u672c\u5730\u6d4f\u89c8\u5668\u3002<\/li>\n<\/ul>\n<p>\u8fdc\u7a0b CDP URL \u53ef\u4ee5\u5305\u542b\u8ba4\u8bc1\u4fe1\u606f\uff1a<\/p>\n<ul>\n<li>\u67e5\u8be2\u4ee4\u724c\uff08\u4f8b\u5982 <code>https:\/\/provider.example?token=&lt;token&gt;<\/code>\uff09<\/li>\n<li>HTTP Basic \u8ba4\u8bc1\uff08\u4f8b\u5982 <code>https:\/\/user:pass@provider.example<\/code>\uff09<\/li>\n<\/ul>\n<p>OpenClaw \u5728\u8c03\u7528 <code>\/json\/*<\/code> \u7aef\u70b9\u548c\u8fde\u63a5 CDP WebSocket \u65f6\u4f1a\u4fdd\u7559\u8ba4\u8bc1\u4fe1\u606f\u3002\u5efa\u8bae\u4f7f\u7528\u73af\u5883\u53d8\u91cf\u6216\u5bc6\u94a5\u7ba1\u7406\u5668\u5b58\u50a8\u4ee4\u724c\uff0c\u800c\u4e0d\u662f\u5c06\u5176\u63d0\u4ea4\u5230\u914d\u7f6e\u6587\u4ef6\u4e2d\u3002<\/p>\n<h2>\u8282\u70b9\u6d4f\u89c8\u5668\u4ee3\u7406\uff08\u96f6\u914d\u7f6e\u9ed8\u8ba4\uff09<\/h2>\n<p>\u5982\u679c\u4f60\u5728\u6709\u6d4f\u89c8\u5668\u7684\u673a\u5668\u4e0a\u8fd0\u884c<strong>\u8282\u70b9\u4e3b\u673a<\/strong>\uff0cOpenClaw \u53ef\u4ee5\u81ea\u52a8\u5c06\u6d4f\u89c8\u5668\u5de5\u5177\u8c03\u7528\u8def\u7531\u5230\u8be5\u8282\u70b9\uff0c\u65e0\u9700\u4efb\u4f55\u989d\u5916\u7684\u6d4f\u89c8\u5668\u914d\u7f6e\u3002\u8fd9\u662f\u8fdc\u7a0b Gateway \u7f51\u5173\u7684\u9ed8\u8ba4\u8def\u5f84\u3002<\/p>\n<p>\u6ce8\u610f\u4e8b\u9879\uff1a<\/p>\n<ul>\n<li>\u8282\u70b9\u4e3b\u673a\u901a\u8fc7<strong>\u4ee3\u7406\u547d\u4ee4<\/strong>\u66b4\u9732\u5176\u672c\u5730\u6d4f\u89c8\u5668\u63a7\u5236\u670d\u52a1\u5668\u3002<\/li>\n<li>\u914d\u7f6e\u6587\u4ef6\u6765\u81ea\u8282\u70b9\u81ea\u5df1\u7684 <code>browser.profiles<\/code> \u914d\u7f6e\uff08\u4e0e\u672c\u5730\u76f8\u540c\uff09\u3002<\/li>\n<li>\u5982\u679c\u4e0d\u9700\u8981\u53ef\u4ee5\u7981\u7528\uff1a<\/li>\n<li>\u5728\u8282\u70b9\u4e0a\uff1a<code>nodeHost.browserProxy.enabled=false<\/code><\/li>\n<li>\u5728 Gateway \u7f51\u5173\u4e0a\uff1a<code>gateway.nodes.browser.mode=\"off\"<\/code><\/li>\n<\/ul>\n<h2>Browserless\uff08\u6258\u7ba1\u8fdc\u7a0b CDP\uff09<\/h2>\n<p><a href=\"https:\/\/browserless.io\">Browserless<\/a> \u662f\u4e00\u4e2a\u6258\u7ba1\u7684 Chromium \u670d\u52a1\uff0c\u901a\u8fc7 HTTPS \u66b4\u9732 CDP \u7aef\u70b9\u3002\u4f60\u53ef\u4ee5\u5c06 OpenClaw \u6d4f\u89c8\u5668\u914d\u7f6e\u6587\u4ef6\u6307\u5411 Browserless \u533a\u57df\u7aef\u70b9\uff0c\u5e76\u4f7f\u7528\u4f60\u7684 API \u5bc6\u94a5\u8fdb\u884c\u8ba4\u8bc1\u3002<\/p>\n<p>\u793a\u4f8b\uff1a<\/p>\n<p>&#8220;`json5  theme={&#8220;theme&#8221;:{&#8220;light&#8221;:&#8221;min-light&#8221;,&#8221;dark&#8221;:&#8221;min-dark&#8221;}}<br \/>\n{<br \/>\n  browser: {<br \/>\n    enabled: true,<br \/>\n    defaultProfile: &#8220;browserless&#8221;,<br \/>\n    remoteCdpTimeoutMs: 2000,<br \/>\n    remoteCdpHandshakeTimeoutMs: 4000,<br \/>\n    profiles: {<br \/>\n      browserless: {<br \/>\n        cdpUrl: &#8220;https:\/\/production-sfo.browserless.io?token=&#8221;,<br \/>\n        color: &#8220;#00AA00&#8221;,<br \/>\n      },<br \/>\n    },<br \/>\n  },<br \/>\n}<\/p>\n<pre><code>\n\u6ce8\u610f\u4e8b\u9879\uff1a\n\n* \u5c06 `&lt;BROWSERLESS_API_KEY&gt;` \u66ff\u6362\u4e3a\u4f60\u771f\u5b9e\u7684 Browserless \u4ee4\u724c\u3002\n* \u9009\u62e9\u4e0e\u4f60\u7684 Browserless \u8d26\u6237\u5339\u914d\u7684\u533a\u57df\u7aef\u70b9\uff08\u8bf7\u53c2\u9605\u5176\u6587\u6863\uff09\u3002\n\n## \u5b89\u5168\u6027\n\n\u6838\u5fc3\u7406\u5ff5\uff1a\n\n* \u6d4f\u89c8\u5668\u63a7\u5236\u4ec5\u9650 loopback\uff1b\u8bbf\u95ee\u901a\u8fc7 Gateway \u7f51\u5173\u7684\u8ba4\u8bc1\u6216\u8282\u70b9\u914d\u5bf9\u8fdb\u884c\u3002\n* \u5c06 Gateway \u7f51\u5173\u548c\u4efb\u4f55\u8282\u70b9\u4e3b\u673a\u4fdd\u6301\u5728\u79c1\u6709\u7f51\u7edc\u4e0a\uff08Tailscale\uff09\uff1b\u907f\u514d\u516c\u5f00\u66b4\u9732\u3002\n* \u5c06\u8fdc\u7a0b CDP URL\/\u4ee4\u724c\u89c6\u4e3a\u673a\u5bc6\uff1b\u4f18\u5148\u4f7f\u7528\u73af\u5883\u53d8\u91cf\u6216\u5bc6\u94a5\u7ba1\u7406\u5668\u3002\n\n\u8fdc\u7a0b CDP \u63d0\u793a\uff1a\n\n* \u5c3d\u53ef\u80fd\u4f7f\u7528 HTTPS \u7aef\u70b9\u548c\u77ed\u671f\u4ee4\u724c\u3002\n* \u907f\u514d\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u76f4\u63a5\u5d4c\u5165\u957f\u671f\u4ee4\u724c\u3002\n\n## \u914d\u7f6e\u6587\u4ef6\uff08\u591a\u6d4f\u89c8\u5668\uff09\n\nOpenClaw \u652f\u6301\u591a\u4e2a\u547d\u540d\u914d\u7f6e\u6587\u4ef6\uff08\u8def\u7531\u914d\u7f6e\uff09\u3002\u914d\u7f6e\u6587\u4ef6\u53ef\u4ee5\u662f\uff1a\n\n* **openclaw \u6258\u7ba1**\uff1a\u5177\u6709\u72ec\u7acb\u7528\u6237\u6570\u636e\u76ee\u5f55\u548c CDP \u7aef\u53e3\u7684\u4e13\u7528\u57fa\u4e8e Chromium \u7684\u6d4f\u89c8\u5668\u5b9e\u4f8b\n* **\u8fdc\u7a0b**\uff1a\u663e\u5f0f CDP URL\uff08\u5728\u5176\u4ed6\u5730\u65b9\u8fd0\u884c\u7684\u57fa\u4e8e Chromium \u7684\u6d4f\u89c8\u5668\uff09\n* **\u6269\u5c55\u4e2d\u7ee7**\uff1a\u901a\u8fc7\u672c\u5730\u4e2d\u7ee7 + Chrome \u6269\u5c55\u8bbf\u95ee\u4f60\u73b0\u6709\u7684 Chrome \u6807\u7b7e\u9875\n\n\u9ed8\u8ba4\u503c\uff1a\n\n* \u5982\u679c\u7f3a\u5c11 `openclaw` \u914d\u7f6e\u6587\u4ef6\uff0c\u4f1a\u81ea\u52a8\u521b\u5efa\u3002\n* `chrome` \u914d\u7f6e\u6587\u4ef6\u662f\u5185\u7f6e\u7684\uff0c\u7528\u4e8e Chrome \u6269\u5c55\u4e2d\u7ee7\uff08\u9ed8\u8ba4\u6307\u5411 `http:\/\/127.0.0.1:18792`\uff09\u3002\n* \u672c\u5730 CDP \u7aef\u53e3\u9ed8\u8ba4\u4ece **18800\u201318899** \u5206\u914d\u3002\n* \u5220\u9664\u914d\u7f6e\u6587\u4ef6\u4f1a\u5c06\u5176\u672c\u5730\u6570\u636e\u76ee\u5f55\u79fb\u81f3\u56de\u6536\u7ad9\u3002\n\n\u6240\u6709\u63a7\u5236\u7aef\u70b9\u63a5\u53d7 `?profile=&lt;name&gt;`\uff1bCLI \u4f7f\u7528 `--browser-profile`\u3002\n\n## Chrome \u6269\u5c55\u4e2d\u7ee7\uff08\u4f7f\u7528\u4f60\u73b0\u6709\u7684 Chrome\uff09\n\nOpenClaw \u8fd8\u53ef\u4ee5\u901a\u8fc7\u672c\u5730 CDP \u4e2d\u7ee7 + Chrome \u6269\u5c55\u9a71\u52a8**\u4f60\u73b0\u6709\u7684 Chrome \u6807\u7b7e\u9875**\uff08\u65e0\u9700\u5355\u72ec\u7684&quot;openclaw&quot;Chrome \u5b9e\u4f8b\uff09\u3002\n\n\u5b8c\u6574\u6307\u5357\uff1a[Chrome \u6269\u5c55](\/tools\/chrome-extension)\n\n\u6d41\u7a0b\uff1a\n\n* Gateway \u7f51\u5173\u5728\u672c\u5730\u8fd0\u884c\uff08\u540c\u4e00\u53f0\u673a\u5668\uff09\u6216\u8282\u70b9\u4e3b\u673a\u5728\u6d4f\u89c8\u5668\u6240\u5728\u673a\u5668\u4e0a\u8fd0\u884c\u3002\n* \u672c\u5730**\u4e2d\u7ee7\u670d\u52a1\u5668**\u5728 loopback \u7684 `cdpUrl` \u4e0a\u76d1\u542c\uff08\u9ed8\u8ba4\uff1a`http:\/\/127.0.0.1:18792`\uff09\u3002\n* \u4f60\u70b9\u51fb\u6807\u7b7e\u9875\u4e0a\u7684 **OpenClaw Browser Relay** \u6269\u5c55\u56fe\u6807\u6765\u9644\u52a0\uff08\u5b83\u4e0d\u4f1a\u81ea\u52a8\u9644\u52a0\uff09\u3002\n* \u667a\u80fd\u4f53\u901a\u8fc7\u9009\u62e9\u6b63\u786e\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u4f7f\u7528\u666e\u901a\u7684 `browser` \u5de5\u5177\u63a7\u5236\u8be5\u6807\u7b7e\u9875\u3002\n\n\u5982\u679c Gateway \u7f51\u5173\u5728\u5176\u4ed6\u5730\u65b9\u8fd0\u884c\uff0c\u8bf7\u5728\u6d4f\u89c8\u5668\u6240\u5728\u673a\u5668\u4e0a\u8fd0\u884c\u8282\u70b9\u4e3b\u673a\uff0c\u4ee5\u4fbf Gateway \u7f51\u5173\u53ef\u4ee5\u4ee3\u7406\u6d4f\u89c8\u5668\u64cd\u4f5c\u3002\n\n### \u6c99\u7bb1\u4f1a\u8bdd\n\n\u5982\u679c\u667a\u80fd\u4f53\u4f1a\u8bdd\u662f\u6c99\u7bb1\u9694\u79bb\u7684\uff0c`browser` \u5de5\u5177\u53ef\u80fd\u9ed8\u8ba4\u4e3a `target=&quot;sandbox&quot;`\uff08\u6c99\u7bb1\u6d4f\u89c8\u5668\uff09\u3002\nChrome \u6269\u5c55\u4e2d\u7ee7\u63a5\u7ba1\u9700\u8981\u4e3b\u673a\u6d4f\u89c8\u5668\u63a7\u5236\uff0c\u56e0\u6b64\u8981\u4e48\uff1a\n\n* \u5728\u975e\u6c99\u7bb1\u6a21\u5f0f\u4e0b\u8fd0\u884c\u4f1a\u8bdd\uff0c\u6216\u8005\n* \u8bbe\u7f6e `agents.defaults.sandbox.browser.allowHostControl: true` \u5e76\u5728\u8c03\u7528\u5de5\u5177\u65f6\u4f7f\u7528 `target=&quot;host&quot;`\u3002\n\n### \u8bbe\u7f6e\n\n1. \u52a0\u8f7d\u6269\u5c55\uff08\u5f00\u53d1\/\u672a\u6253\u5305\uff09\uff1a\n\n```bash  theme={&quot;theme&quot;:{&quot;light&quot;:&quot;min-light&quot;,&quot;dark&quot;:&quot;min-dark&quot;}}\nopenclaw browser extension install\n<\/code><\/pre>\n<ul>\n<li>Chrome \u2192 <code>chrome:\/\/extensions<\/code> \u2192 \u542f\u7528&#8221;\u5f00\u53d1\u8005\u6a21\u5f0f&#8221;<\/li>\n<li>&#8220;\u52a0\u8f7d\u5df2\u89e3\u538b\u7684\u6269\u5c55\u7a0b\u5e8f&#8221; \u2192 \u9009\u62e9 <code>openclaw browser extension path<\/code> \u6253\u5370\u7684\u76ee\u5f55<\/li>\n<li>\u56fa\u5b9a\u6269\u5c55\uff0c\u7136\u540e\u5728\u4f60\u60f3\u8981\u63a7\u5236\u7684\u6807\u7b7e\u9875\u4e0a\u70b9\u51fb\u5b83\uff08\u5fbd\u7ae0\u663e\u793a <code>ON<\/code>\uff09\u3002<\/li>\n<\/ul>\n<ol start=\"2\">\n<li>\u4f7f\u7528\u5b83\uff1a<\/li>\n<\/ol>\n<ul>\n<li>CLI\uff1a<code>openclaw browser --browser-profile chrome tabs<\/code><\/li>\n<li>\u667a\u80fd\u4f53\u5de5\u5177\uff1a<code>browser<\/code> \u914d\u5408 <code>profile=\"chrome\"<\/code><\/li>\n<\/ul>\n<p>\u53ef\u9009\uff1a\u5982\u679c\u4f60\u60f3\u8981\u4e0d\u540c\u7684\u540d\u79f0\u6216\u4e2d\u7ee7\u7aef\u53e3\uff0c\u521b\u5efa\u4f60\u81ea\u5df1\u7684\u914d\u7f6e\u6587\u4ef6\uff1a<\/p>\n<p>&#8220;`bash  theme={&#8220;theme&#8221;:{&#8220;light&#8221;:&#8221;min-light&#8221;,&#8221;dark&#8221;:&#8221;min-dark&#8221;}}<br \/>\nopenclaw browser create-profile<br \/>\n  &#8211;name my-chrome<br \/>\n  &#8211;driver extension<br \/>\n  &#8211;cdp-url http:\/\/127.0.0.1:18792<br \/>\n  &#8211;color &#8220;#00AA00&#8221;<\/p>\n<pre><code>\n\u6ce8\u610f\u4e8b\u9879\uff1a\n\n* \u6b64\u6a21\u5f0f\u4f9d\u8d56 Playwright-on-CDP \u8fdb\u884c\u5927\u591a\u6570\u64cd\u4f5c\uff08\u622a\u56fe\/\u5feb\u7167\/\u64cd\u4f5c\uff09\u3002\n* \u518d\u6b21\u70b9\u51fb\u6269\u5c55\u56fe\u6807\u53ef\u5206\u79bb\u3002\n\n## \u9694\u79bb\u4fdd\u8bc1\n\n* **\u4e13\u7528\u7528\u6237\u6570\u636e\u76ee\u5f55**\uff1a\u6c38\u4e0d\u89e6\u53ca\u4f60\u7684\u4e2a\u4eba\u6d4f\u89c8\u5668\u914d\u7f6e\u6587\u4ef6\u3002\n* **\u4e13\u7528\u7aef\u53e3**\uff1a\u907f\u514d\u4f7f\u7528 `9222` \u4ee5\u9632\u6b62\u4e0e\u5f00\u53d1\u5de5\u4f5c\u6d41\u51b2\u7a81\u3002\n* **\u786e\u5b9a\u6027\u6807\u7b7e\u9875\u63a7\u5236**\uff1a\u901a\u8fc7 `targetId` \u5b9a\u4f4d\u6807\u7b7e\u9875\uff0c\u800c\u975e&quot;\u6700\u540e\u4e00\u4e2a\u6807\u7b7e\u9875&quot;\u3002\n\n## \u6d4f\u89c8\u5668\u9009\u62e9\n\n\u672c\u5730\u542f\u52a8\u65f6\uff0cOpenClaw \u9009\u62e9\u7b2c\u4e00\u4e2a\u53ef\u7528\u7684\uff1a\n\n1. Chrome\n2. Brave\n3. Edge\n4. Chromium\n5. Chrome Canary\n\n\u4f60\u53ef\u4ee5\u4f7f\u7528 `browser.executablePath` \u8986\u76d6\u3002\n\n\u5e73\u53f0\uff1a\n\n* macOS\uff1a\u68c0\u67e5 `\/Applications` \u548c `~\/Applications`\u3002\n* Linux\uff1a\u67e5\u627e `google-chrome`\u3001`brave`\u3001`microsoft-edge`\u3001`chromium` \u7b49\u3002\n* Windows\uff1a\u68c0\u67e5\u5e38\u89c1\u5b89\u88c5\u4f4d\u7f6e\u3002\n\n## \u63a7\u5236 API\uff08\u53ef\u9009\uff09\n\n\u4ec5\u7528\u4e8e\u672c\u5730\u96c6\u6210\uff0cGateway \u7f51\u5173\u66b4\u9732\u4e00\u4e2a\u5c0f\u578b\u7684 loopback HTTP API\uff1a\n\n* \u72b6\u6001\/\u542f\u52a8\/\u505c\u6b62\uff1a`GET \/`\u3001`POST \/start`\u3001`POST \/stop`\n* \u6807\u7b7e\u9875\uff1a`GET \/tabs`\u3001`POST \/tabs\/open`\u3001`POST \/tabs\/focus`\u3001`DELETE \/tabs\/:targetId`\n* \u5feb\u7167\/\u622a\u56fe\uff1a`GET \/snapshot`\u3001`POST \/screenshot`\n* \u64cd\u4f5c\uff1a`POST \/navigate`\u3001`POST \/act`\n* \u94a9\u5b50\uff1a`POST \/hooks\/file-chooser`\u3001`POST \/hooks\/dialog`\n* \u4e0b\u8f7d\uff1a`POST \/download`\u3001`POST \/wait\/download`\n* \u8c03\u8bd5\uff1a`GET \/console`\u3001`POST \/pdf`\n* \u8c03\u8bd5\uff1a`GET \/errors`\u3001`GET \/requests`\u3001`POST \/trace\/start`\u3001`POST \/trace\/stop`\u3001`POST \/highlight`\n* \u7f51\u7edc\uff1a`POST \/response\/body`\n* \u72b6\u6001\uff1a`GET \/cookies`\u3001`POST \/cookies\/set`\u3001`POST \/cookies\/clear`\n* \u72b6\u6001\uff1a`GET \/storage\/:kind`\u3001`POST \/storage\/:kind\/set`\u3001`POST \/storage\/:kind\/clear`\n* \u8bbe\u7f6e\uff1a`POST \/set\/offline`\u3001`POST \/set\/headers`\u3001`POST \/set\/credentials`\u3001`POST \/set\/geolocation`\u3001`POST \/set\/media`\u3001`POST \/set\/timezone`\u3001`POST \/set\/locale`\u3001`POST \/set\/device`\n\n\u6240\u6709\u7aef\u70b9\u63a5\u53d7 `?profile=&lt;name&gt;`\u3002\n\n### Playwright \u8981\u6c42\n\n\u67d0\u4e9b\u529f\u80fd\uff08navigate\/act\/AI \u5feb\u7167\/\u89d2\u8272\u5feb\u7167\u3001\u5143\u7d20\u622a\u56fe\u3001PDF\uff09\u9700\u8981 Playwright\u3002\u5982\u679c\u672a\u5b89\u88c5 Playwright\uff0c\u8fd9\u4e9b\u7aef\u70b9\u4f1a\u8fd4\u56de\u660e\u786e\u7684 501 \u9519\u8bef\u3002ARIA \u5feb\u7167\u548c\u57fa\u672c\u622a\u56fe\u5bf9\u4e8e openclaw \u6258\u7ba1\u7684 Chrome \u4ecd\u7136\u6709\u6548\u3002\u5bf9\u4e8e Chrome \u6269\u5c55\u4e2d\u7ee7\u9a71\u52a8\u7a0b\u5e8f\uff0cARIA \u5feb\u7167\u548c\u622a\u56fe\u9700\u8981 Playwright\u3002\n\n\u5982\u679c\u4f60\u770b\u5230 `Playwright is not available in this gateway build`\uff0c\u8bf7\u5b89\u88c5\u5b8c\u6574\u7684 Playwright \u5305\uff08\u4e0d\u662f `playwright-core`\uff09\u5e76\u91cd\u542f Gateway \u7f51\u5173\uff0c\u6216\u8005\u91cd\u65b0\u5b89\u88c5\u5e26\u6d4f\u89c8\u5668\u652f\u6301\u7684 OpenClaw\u3002\n\n#### Docker Playwright \u5b89\u88c5\n\n\u5982\u679c\u4f60\u7684 Gateway \u7f51\u5173\u5728 Docker \u4e2d\u8fd0\u884c\uff0c\u907f\u514d\u4f7f\u7528 `npx playwright`\uff08npm \u8986\u76d6\u51b2\u7a81\uff09\u3002\u6539\u7528\u6346\u7ed1\u7684 CLI\uff1a\n\n```bash  theme={&quot;theme&quot;:{&quot;light&quot;:&quot;min-light&quot;,&quot;dark&quot;:&quot;min-dark&quot;}}\ndocker compose run --rm openclaw-cli \n  node \/app\/node_modules\/playwright-core\/cli.js install chromium\n<\/code><\/pre>\n<p>\u8981\u6301\u4e45\u5316\u6d4f\u89c8\u5668\u4e0b\u8f7d\uff0c\u8bbe\u7f6e <code>PLAYWRIGHT_BROWSERS_PATH<\/code>\uff08\u4f8b\u5982 <code>\/home\/node\/.cache\/ms-playwright<\/code>\uff09\u5e76\u786e\u4fdd <code>\/home\/node<\/code> \u901a\u8fc7 <code>OPENCLAW_HOME_VOLUME<\/code> \u6216\u7ed1\u5b9a\u6302\u8f7d\u6301\u4e45\u5316\u3002\u53c2\u89c1 <a href=\"\/install\/docker\">Docker<\/a>\u3002<\/p>\n<h2>\u5de5\u4f5c\u539f\u7406\uff08\u5185\u90e8\uff09<\/h2>\n<p>\u9ad8\u5c42\u6d41\u7a0b\uff1a<\/p>\n<ul>\n<li>\u4e00\u4e2a\u5c0f\u578b<strong>\u63a7\u5236\u670d\u52a1\u5668<\/strong>\u63a5\u53d7 HTTP \u8bf7\u6c42\u3002<\/li>\n<li>\u5b83\u901a\u8fc7 <strong>CDP<\/strong> \u8fde\u63a5\u5230\u57fa\u4e8e Chromium \u7684\u6d4f\u89c8\u5668\uff08Chrome\/Brave\/Edge\/Chromium\uff09\u3002<\/li>\n<li>\u5bf9\u4e8e\u9ad8\u7ea7\u64cd\u4f5c\uff08\u70b9\u51fb\/\u8f93\u5165\/\u5feb\u7167\/PDF\uff09\uff0c\u5b83\u5728 CDP \u4e4b\u4e0a\u4f7f\u7528 <strong>Playwright<\/strong>\u3002<\/li>\n<li>\u5f53\u7f3a\u5c11 Playwright \u65f6\uff0c\u4ec5\u975e Playwright \u64cd\u4f5c\u53ef\u7528\u3002<\/li>\n<\/ul>\n<p>\u8fd9\u79cd\u8bbe\u8ba1\u4f7f\u667a\u80fd\u4f53\u4fdd\u6301\u5728\u7a33\u5b9a\u3001\u786e\u5b9a\u6027\u7684\u63a5\u53e3\u4e0a\uff0c\u540c\u65f6\u8ba9\u4f60\u53ef\u4ee5\u5207\u6362\u672c\u5730\/\u8fdc\u7a0b\u6d4f\u89c8\u5668\u548c\u914d\u7f6e\u6587\u4ef6\u3002<\/p>\n<h2>CLI \u5feb\u901f\u53c2\u8003<\/h2>\n<p>\u6240\u6709\u547d\u4ee4\u63a5\u53d7 <code>--browser-profile &lt;name&gt;<\/code> \u4ee5\u5b9a\u4f4d\u7279\u5b9a\u914d\u7f6e\u6587\u4ef6\u3002<br \/>\n\u6240\u6709\u547d\u4ee4\u4e5f\u63a5\u53d7 <code>--json<\/code> \u4ee5\u83b7\u5f97\u673a\u5668\u53ef\u8bfb\u7684\u8f93\u51fa\uff08\u7a33\u5b9a\u7684\u8d1f\u8f7d\uff09\u3002<\/p>\n<p>\u57fa\u7840\u64cd\u4f5c\uff1a<\/p>\n<ul>\n<li><code>openclaw browser status<\/code><\/li>\n<li><code>openclaw browser start<\/code><\/li>\n<li><code>openclaw browser stop<\/code><\/li>\n<li><code>openclaw browser tabs<\/code><\/li>\n<li><code>openclaw browser tab<\/code><\/li>\n<li><code>openclaw browser tab new<\/code><\/li>\n<li><code>openclaw browser tab select 2<\/code><\/li>\n<li><code>openclaw browser tab close 2<\/code><\/li>\n<li><code>openclaw browser open https:\/\/example.com<\/code><\/li>\n<li><code>openclaw browser focus abcd1234<\/code><\/li>\n<li><code>openclaw browser close abcd1234<\/code><\/li>\n<\/ul>\n<p>\u68c0\u67e5\uff1a<\/p>\n<ul>\n<li><code>openclaw browser screenshot<\/code><\/li>\n<li><code>openclaw browser screenshot --full-page<\/code><\/li>\n<li><code>openclaw browser screenshot --ref 12<\/code><\/li>\n<li><code>openclaw browser screenshot --ref e12<\/code><\/li>\n<li><code>openclaw browser snapshot<\/code><\/li>\n<li><code>openclaw browser snapshot --format aria --limit 200<\/code><\/li>\n<li><code>openclaw browser snapshot --interactive --compact --depth 6<\/code><\/li>\n<li><code>openclaw browser snapshot --efficient<\/code><\/li>\n<li><code>openclaw browser snapshot --labels<\/code><\/li>\n<li><code>openclaw browser snapshot --selector \"#main\" --interactive<\/code><\/li>\n<li><code>openclaw browser snapshot --frame \"iframe#main\" --interactive<\/code><\/li>\n<li><code>openclaw browser console --level error<\/code><\/li>\n<li><code>openclaw browser errors --clear<\/code><\/li>\n<li><code>openclaw browser requests --filter api --clear<\/code><\/li>\n<li><code>openclaw browser pdf<\/code><\/li>\n<li><code>openclaw browser responsebody \"**\/api\" --max-chars 5000<\/code><\/li>\n<\/ul>\n<p>\u64cd\u4f5c\uff1a<\/p>\n<ul>\n<li><code>openclaw browser navigate https:\/\/example.com<\/code><\/li>\n<li><code>openclaw browser resize 1280 720<\/code><\/li>\n<li><code>openclaw browser click 12 --double<\/code><\/li>\n<li><code>openclaw browser click e12 --double<\/code><\/li>\n<li><code>openclaw browser type 23 \"hello\" --submit<\/code><\/li>\n<li><code>openclaw browser press Enter<\/code><\/li>\n<li><code>openclaw browser hover 44<\/code><\/li>\n<li><code>openclaw browser scrollintoview e12<\/code><\/li>\n<li><code>openclaw browser drag 10 11<\/code><\/li>\n<li><code>openclaw browser select 9 OptionA OptionB<\/code><\/li>\n<li><code>openclaw browser download e12 \/tmp\/report.pdf<\/code><\/li>\n<li><code>openclaw browser waitfordownload \/tmp\/report.pdf<\/code><\/li>\n<li><code>openclaw browser upload \/tmp\/file.pdf<\/code><\/li>\n<li><code>openclaw browser fill --fields '[{\"ref\":\"1\",\"type\":\"text\",\"value\":\"Ada\"}]'<\/code><\/li>\n<li><code>openclaw browser dialog --accept<\/code><\/li>\n<li><code>openclaw browser wait --text \"Done\"<\/code><\/li>\n<li><code>openclaw browser wait \"#main\" --url \"**\/dash\" --load networkidle --fn \"window.ready===true\"<\/code><\/li>\n<li><code>openclaw browser evaluate --fn '(el) =&gt; el.textContent' --ref 7<\/code><\/li>\n<li><code>openclaw browser highlight e12<\/code><\/li>\n<li><code>openclaw browser trace start<\/code><\/li>\n<li><code>openclaw browser trace stop<\/code><\/li>\n<\/ul>\n<p>\u72b6\u6001\uff1a<\/p>\n<ul>\n<li><code>openclaw browser cookies<\/code><\/li>\n<li><code>openclaw browser cookies set session abc123 --url \"https:\/\/example.com\"<\/code><\/li>\n<li><code>openclaw browser cookies clear<\/code><\/li>\n<li><code>openclaw browser storage local get<\/code><\/li>\n<li><code>openclaw browser storage local set theme dark<\/code><\/li>\n<li><code>openclaw browser storage session clear<\/code><\/li>\n<li><code>openclaw browser set offline on<\/code><\/li>\n<li><code>openclaw browser set headers --json '{\"X-Debug\":\"1\"}'<\/code><\/li>\n<li><code>openclaw browser set credentials user pass<\/code><\/li>\n<li><code>openclaw browser set credentials --clear<\/code><\/li>\n<li><code>openclaw browser set geo 37.7749 -122.4194 --origin \"https:\/\/example.com\"<\/code><\/li>\n<li><code>openclaw browser set geo --clear<\/code><\/li>\n<li><code>openclaw browser set media dark<\/code><\/li>\n<li><code>openclaw browser set timezone America\/New_York<\/code><\/li>\n<li><code>openclaw browser set locale en-US<\/code><\/li>\n<li><code>openclaw browser set device \"iPhone 14\"<\/code><\/li>\n<\/ul>\n<p>\u6ce8\u610f\u4e8b\u9879\uff1a<\/p>\n<ul>\n<li><code>upload<\/code> \u548c <code>dialog<\/code> \u662f<strong>\u9884\u5907<\/strong>\u8c03\u7528\uff1b\u5728\u89e6\u53d1\u9009\u62e9\u5668\/\u5bf9\u8bdd\u6846\u7684\u70b9\u51fb\/\u6309\u952e\u4e4b\u524d\u8fd0\u884c\u5b83\u4eec\u3002<\/li>\n<li><code>upload<\/code> \u4e5f\u53ef\u4ee5\u901a\u8fc7 <code>--input-ref<\/code> \u6216 <code>--element<\/code> \u76f4\u63a5\u8bbe\u7f6e\u6587\u4ef6\u8f93\u5165\u3002<\/li>\n<li><code>snapshot<\/code>\uff1a<\/li>\n<li><code>--format ai<\/code>\uff08\u5b89\u88c5 Playwright \u65f6\u7684\u9ed8\u8ba4\u503c\uff09\uff1a\u8fd4\u56de\u5e26\u6709\u6570\u5b57 ref \u7684 AI \u5feb\u7167\uff08<code>aria-ref=\"&lt;n&gt;\"<\/code>\uff09\u3002<\/li>\n<li><code>--format aria<\/code>\uff1a\u8fd4\u56de\u65e0\u969c\u788d\u6811\uff08\u65e0 ref\uff1b\u4ec5\u4f9b\u68c0\u67e5\uff09\u3002<\/li>\n<li><code>--efficient<\/code>\uff08\u6216 <code>--mode efficient<\/code>\uff09\uff1a\u7d27\u51d1\u89d2\u8272\u5feb\u7167\u9884\u8bbe\uff08interactive + compact + depth + \u8f83\u4f4e\u7684 maxChars\uff09\u3002<\/li>\n<li>\u914d\u7f6e\u9ed8\u8ba4\u503c\uff08\u4ec5\u9650\u5de5\u5177\/CLI\uff09\uff1a\u8bbe\u7f6e <code>browser.snapshotDefaults.mode: \"efficient\"<\/code> \u4ee5\u5728\u8c03\u7528\u8005\u672a\u4f20\u9012\u6a21\u5f0f\u65f6\u4f7f\u7528\u9ad8\u6548\u5feb\u7167\uff08\u53c2\u89c1 <a href=\"\/gateway\/configuration#browser-openclaw-managed-browser\">Gateway \u7f51\u5173\u914d\u7f6e<\/a>\uff09\u3002<\/li>\n<li>\u89d2\u8272\u5feb\u7167\u9009\u9879\uff08<code>--interactive<\/code>\u3001<code>--compact<\/code>\u3001<code>--depth<\/code>\u3001<code>--selector<\/code>\uff09\u5f3a\u5236\u4f7f\u7528\u5e26\u6709 <code>ref=e12<\/code> \u7b49 ref \u7684\u57fa\u4e8e\u89d2\u8272\u7684\u5feb\u7167\u3002<\/li>\n<li><code>--frame \"&lt;iframe selector&gt;\"<\/code> \u5c06\u89d2\u8272\u5feb\u7167\u8303\u56f4\u9650\u5b9a\u5230 iframe\uff08\u4e0e <code>e12<\/code> \u7b49\u89d2\u8272 ref \u914d\u5408\u4f7f\u7528\uff09\u3002<\/li>\n<li><code>--interactive<\/code> \u8f93\u51fa\u4e00\u4e2a\u6241\u5e73\u7684\u3001\u6613\u4e8e\u9009\u62e9\u7684\u4ea4\u4e92\u5143\u7d20\u5217\u8868\uff08\u6700\u9002\u5408\u9a71\u52a8\u64cd\u4f5c\uff09\u3002<\/li>\n<li><code>--labels<\/code> \u6dfb\u52a0\u4e00\u4e2a\u5e26\u6709\u53e0\u52a0 ref \u6807\u7b7e\u7684\u89c6\u53e3\u622a\u56fe\uff08\u6253\u5370 <code>MEDIA:&lt;path&gt;<\/code>\uff09\u3002<\/li>\n<li><code>click<\/code>\/<code>type<\/code> \u7b49\u9700\u8981\u6765\u81ea <code>snapshot<\/code> \u7684 <code>ref<\/code>\uff08\u6570\u5b57 <code>12<\/code> \u6216\u89d2\u8272 ref <code>e12<\/code>\uff09\u3002<br \/>\n  \u64cd\u4f5c\u6545\u610f\u4e0d\u652f\u6301 CSS \u9009\u62e9\u5668\u3002<\/li>\n<\/ul>\n<h2>\u5feb\u7167\u548c ref<\/h2>\n<p>OpenClaw \u652f\u6301\u4e24\u79cd&#8221;\u5feb\u7167&#8221;\u98ce\u683c\uff1a<\/p>\n<ul>\n<li><strong>AI \u5feb\u7167\uff08\u6570\u5b57 ref\uff09<\/strong>\uff1a<code>openclaw browser snapshot<\/code>\uff08\u9ed8\u8ba4\uff1b<code>--format ai<\/code>\uff09<\/li>\n<li>\u8f93\u51fa\uff1a\u5305\u542b\u6570\u5b57 ref \u7684\u6587\u672c\u5feb\u7167\u3002<\/li>\n<li>\u64cd\u4f5c\uff1a<code>openclaw browser click 12<\/code>\u3001<code>openclaw browser type 23 \"hello\"<\/code>\u3002<\/li>\n<li>\n<p>\u5185\u90e8\u901a\u8fc7 Playwright \u7684 <code>aria-ref<\/code> \u89e3\u6790 ref\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u89d2\u8272\u5feb\u7167\uff08\u89d2\u8272 ref \u5982 <code>e12<\/code>\uff09<\/strong>\uff1a<code>openclaw browser snapshot --interactive<\/code>\uff08\u6216 <code>--compact<\/code>\u3001<code>--depth<\/code>\u3001<code>--selector<\/code>\u3001<code>--frame<\/code>\uff09<\/p>\n<\/li>\n<li>\u8f93\u51fa\uff1a\u5e26\u6709 <code>[ref=e12]<\/code>\uff08\u548c\u53ef\u9009\u7684 <code>[nth=1]<\/code>\uff09\u7684\u57fa\u4e8e\u89d2\u8272\u7684\u5217\u8868\/\u6811\u3002<\/li>\n<li>\u64cd\u4f5c\uff1a<code>openclaw browser click e12<\/code>\u3001<code>openclaw browser highlight e12<\/code>\u3002<\/li>\n<li>\u5185\u90e8\u901a\u8fc7 <code>getByRole(...)<\/code>\uff08\u52a0\u4e0a\u91cd\u590d\u9879\u7684 <code>nth()<\/code>\uff09\u89e3\u6790 ref\u3002<\/li>\n<li>\u6dfb\u52a0 <code>--labels<\/code> \u53ef\u5305\u542b\u5e26\u6709\u53e0\u52a0 <code>e12<\/code> \u6807\u7b7e\u7684\u89c6\u53e3\u622a\u56fe\u3002<\/li>\n<\/ul>\n<p>ref \u884c\u4e3a\uff1a<\/p>\n<ul>\n<li>ref \u5728<strong>\u5bfc\u822a\u4e4b\u95f4\u4e0d\u7a33\u5b9a<\/strong>\uff1b\u5982\u679c\u51fa\u9519\uff0c\u91cd\u65b0\u8fd0\u884c <code>snapshot<\/code> \u5e76\u4f7f\u7528\u65b0\u7684 ref\u3002<\/li>\n<li>\u5982\u679c\u89d2\u8272\u5feb\u7167\u662f\u4f7f\u7528 <code>--frame<\/code> \u62cd\u6444\u7684\uff0c\u89d2\u8272 ref \u5c06\u9650\u5b9a\u5728\u8be5 iframe \u5185\uff0c\u76f4\u5230\u4e0b\u4e00\u6b21\u89d2\u8272\u5feb\u7167\u3002<\/li>\n<\/ul>\n<h2>\u7b49\u5f85\u589e\u5f3a\u529f\u80fd<\/h2>\n<p>\u4f60\u53ef\u4ee5\u7b49\u5f85\u7684\u4e0d\u4ec5\u4ec5\u662f\u65f6\u95f4\/\u6587\u672c\uff1a<\/p>\n<ul>\n<li>\u7b49\u5f85 URL\uff08Playwright \u652f\u6301\u901a\u914d\u7b26\uff09\uff1a<\/li>\n<li><code>openclaw browser wait --url \"**\/dash\"<\/code><\/li>\n<li>\u7b49\u5f85\u52a0\u8f7d\u72b6\u6001\uff1a<\/li>\n<li><code>openclaw browser wait --load networkidle<\/code><\/li>\n<li>\u7b49\u5f85 JS \u65ad\u8a00\uff1a<\/li>\n<li><code>openclaw browser wait --fn \"window.ready===true\"<\/code><\/li>\n<li>\u7b49\u5f85\u9009\u62e9\u5668\u53d8\u5f97\u53ef\u89c1\uff1a<\/li>\n<li><code>openclaw browser wait \"#main\"<\/code><\/li>\n<\/ul>\n<p>\u8fd9\u4e9b\u53ef\u4ee5\u7ec4\u5408\u4f7f\u7528\uff1a<\/p>\n<p>&#8220;`bash  theme={&#8220;theme&#8221;:{&#8220;light&#8221;:&#8221;min-light&#8221;,&#8221;dark&#8221;:&#8221;min-dark&#8221;}}<br \/>\nopenclaw browser wait &#8220;#main&#8221;<br \/>\n  &#8211;url &#8220;**\/dash&#8221;<br \/>\n  &#8211;load networkidle<br \/>\n  &#8211;fn &#8220;window.ready===true&#8221;<br \/>\n  &#8211;timeout-ms 15000<\/p>\n<pre><code>\n## \u8c03\u8bd5\u5de5\u4f5c\u6d41\n\n\u5f53\u64cd\u4f5c\u5931\u8d25\u65f6\uff08\u4f8b\u5982&quot;not visible&quot;\u3001&quot;strict mode violation&quot;\u3001&quot;covered&quot;\uff09\uff1a\n\n1. `openclaw browser snapshot --interactive`\n2. \u4f7f\u7528 `click &lt;ref&gt;` \/ `type &lt;ref&gt;`\uff08\u5728\u4ea4\u4e92\u6a21\u5f0f\u4e0b\u4f18\u5148\u4f7f\u7528\u89d2\u8272 ref\uff09\n3. \u5982\u679c\u4ecd\u7136\u5931\u8d25\uff1a`openclaw browser highlight &lt;ref&gt;` \u67e5\u770b Playwright \u5b9a\u4f4d\u7684\u76ee\u6807\n4. \u5982\u679c\u9875\u9762\u884c\u4e3a\u5f02\u5e38\uff1a\n   * `openclaw browser errors --clear`\n   * `openclaw browser requests --filter api --clear`\n5. \u6df1\u5ea6\u8c03\u8bd5\uff1a\u5f55\u5236 trace\uff1a\n   * `openclaw browser trace start`\n   * \u91cd\u73b0\u95ee\u9898\n   * `openclaw browser trace stop`\uff08\u6253\u5370 `TRACE:&lt;path&gt;`\uff09\n\n## JSON \u8f93\u51fa\n\n`--json` \u7528\u4e8e\u811a\u672c\u548c\u7ed3\u6784\u5316\u5de5\u5177\u3002\n\n\u793a\u4f8b\uff1a\n\n```bash  theme={&quot;theme&quot;:{&quot;light&quot;:&quot;min-light&quot;,&quot;dark&quot;:&quot;min-dark&quot;}}\nopenclaw browser status --json\nopenclaw browser snapshot --interactive --json\nopenclaw browser requests --filter api --json\nopenclaw browser cookies --json\n<\/code><\/pre>\n<p>JSON \u683c\u5f0f\u7684\u89d2\u8272\u5feb\u7167\u5305\u542b <code>refs<\/code> \u52a0\u4e0a\u4e00\u4e2a\u5c0f\u7684 <code>stats<\/code> \u5757\uff08lines\/chars\/refs\/interactive\uff09\uff0c\u4ee5\u4fbf\u5de5\u5177\u53ef\u4ee5\u63a8\u65ad\u8d1f\u8f7d\u5927\u5c0f\u548c\u5bc6\u5ea6\u3002<\/p>\n<h2>\u72b6\u6001\u548c\u73af\u5883\u5f00\u5173<\/h2>\n<p>\u8fd9\u4e9b\u5bf9\u4e8e&#8221;\u8ba9\u7f51\u7ad9\u8868\u73b0\u5f97\u50cf X&#8221;\u7684\u5de5\u4f5c\u6d41\u5f88\u6709\u7528\uff1a<\/p>\n<ul>\n<li>Cookies\uff1a<code>cookies<\/code>\u3001<code>cookies set<\/code>\u3001<code>cookies clear<\/code><\/li>\n<li>\u5b58\u50a8\uff1a<code>storage local|session get|set|clear<\/code><\/li>\n<li>\u79bb\u7ebf\uff1a<code>set offline on|off<\/code><\/li>\n<li>\u8bf7\u6c42\u5934\uff1a<code>set headers --json '{\"X-Debug\":\"1\"}'<\/code>\uff08\u6216 <code>--clear<\/code>\uff09<\/li>\n<li>HTTP basic \u8ba4\u8bc1\uff1a<code>set credentials user pass<\/code>\uff08\u6216 <code>--clear<\/code>\uff09<\/li>\n<li>\u5730\u7406\u4f4d\u7f6e\uff1a<code>set geo &lt;lat&gt; &lt;lon&gt; --origin \"https:\/\/example.com\"<\/code>\uff08\u6216 <code>--clear<\/code>\uff09<\/li>\n<li>\u5a92\u4f53\uff1a<code>set media dark|light|no-preference|none<\/code><\/li>\n<li>\u65f6\u533a\/\u8bed\u8a00\u73af\u5883\uff1a<code>set timezone ...<\/code>\u3001<code>set locale ...<\/code><\/li>\n<li>\u8bbe\u5907\/\u89c6\u53e3\uff1a<\/li>\n<li><code>set device \"iPhone 14\"<\/code>\uff08Playwright \u8bbe\u5907\u9884\u8bbe\uff09<\/li>\n<li><code>set viewport 1280 720<\/code><\/li>\n<\/ul>\n<h2>\u5b89\u5168\u4e0e\u9690\u79c1<\/h2>\n<ul>\n<li>openclaw \u6d4f\u89c8\u5668\u914d\u7f6e\u6587\u4ef6\u53ef\u80fd\u5305\u542b\u5df2\u767b\u5f55\u7684\u4f1a\u8bdd\uff1b\u8bf7\u5c06\u5176\u89c6\u4e3a\u654f\u611f\u4fe1\u606f\u3002<\/li>\n<li><code>browser act kind=evaluate<\/code> \/ <code>openclaw browser evaluate<\/code> \u548c <code>wait --fn<\/code> \u5728\u9875\u9762\u4e0a\u4e0b\u6587\u4e2d\u6267\u884c\u4efb\u610f JavaScript\u3002\u63d0\u793a\u6ce8\u5165\u53ef\u80fd\u4f1a\u64cd\u7eb5\u5b83\u3002\u5982\u679c\u4e0d\u9700\u8981\uff0c\u8bf7\u4f7f\u7528 <code>browser.evaluateEnabled=false<\/code> \u7981\u7528\u5b83\u3002<\/li>\n<li>\u6709\u5173\u767b\u5f55\u548c\u53cd\u673a\u5668\u4eba\u6ce8\u610f\u4e8b\u9879\uff08X\/Twitter \u7b49\uff09\uff0c\u8bf7\u53c2\u9605 <a href=\"\/tools\/browser-login\">\u6d4f\u89c8\u5668\u767b\u5f55 + X\/Twitter \u53d1\u5e16<\/a>\u3002<\/li>\n<li>\u4fdd\u6301 Gateway \u7f51\u5173\/\u8282\u70b9\u4e3b\u673a\u79c1\u6709\uff08\u4ec5\u9650 loopback \u6216 tailnet\uff09\u3002<\/li>\n<li>\u8fdc\u7a0b CDP \u7aef\u70b9\u529f\u80fd\u5f3a\u5927\uff1b\u8bf7\u901a\u8fc7\u96a7\u9053\u4fdd\u62a4\u5b83\u4eec\u3002<\/li>\n<\/ul>\n<h2>\u6545\u969c\u6392\u9664<\/h2>\n<p>\u6709\u5173 Linux \u7279\u5b9a\u95ee\u9898\uff08\u7279\u522b\u662f snap Chromium\uff09\uff0c\u8bf7\u53c2\u9605<a href=\"\/tools\/browser-linux-troubleshooting\">\u6d4f\u89c8\u5668\u6545\u969c\u6392\u9664<\/a>\u3002<\/p>\n<h2>\u667a\u80fd\u4f53\u5de5\u5177 + \u63a7\u5236\u5de5\u4f5c\u539f\u7406<\/h2>\n<p>\u667a\u80fd\u4f53\u83b7\u5f97<strong>\u4e00\u4e2a\u5de5\u5177<\/strong>\u7528\u4e8e\u6d4f\u89c8\u5668\u81ea\u52a8\u5316\uff1a<\/p>\n<ul>\n<li><code>browser<\/code> \u2014 status\/start\/stop\/tabs\/open\/focus\/close\/snapshot\/screenshot\/navigate\/act<\/li>\n<\/ul>\n<p>\u6620\u5c04\u65b9\u5f0f\uff1a<\/p>\n<ul>\n<li><code>browser snapshot<\/code> \u8fd4\u56de\u7a33\u5b9a\u7684 UI \u6811\uff08AI \u6216 ARIA\uff09\u3002<\/li>\n<li><code>browser act<\/code> \u4f7f\u7528\u5feb\u7167 <code>ref<\/code> ID \u6765\u70b9\u51fb\/\u8f93\u5165\/\u62d6\u52a8\/\u9009\u62e9\u3002<\/li>\n<li><code>browser screenshot<\/code> \u6355\u83b7\u50cf\u7d20\uff08\u6574\u9875\u6216\u5143\u7d20\uff09\u3002<\/li>\n<li><code>browser<\/code> \u63a5\u53d7\uff1a<\/li>\n<li><code>profile<\/code> \u6765\u9009\u62e9\u547d\u540d\u7684\u6d4f\u89c8\u5668\u914d\u7f6e\u6587\u4ef6\uff08openclaw\u3001chrome \u6216\u8fdc\u7a0b CDP\uff09\u3002<\/li>\n<li><code>target<\/code>\uff08<code>sandbox<\/code> | <code>host<\/code> | <code>node<\/code>\uff09\u6765\u9009\u62e9\u6d4f\u89c8\u5668\u6240\u5728\u4f4d\u7f6e\u3002<\/li>\n<li>\u5728\u6c99\u7bb1\u4f1a\u8bdd\u4e2d\uff0c<code>target: \"host\"<\/code> \u9700\u8981 <code>agents.defaults.sandbox.browser.allowHostControl=true<\/code>\u3002<\/li>\n<li>\u5982\u679c\u7701\u7565 <code>target<\/code>\uff1a\u6c99\u7bb1\u4f1a\u8bdd\u9ed8\u8ba4\u4e3a <code>sandbox<\/code>\uff0c\u975e\u6c99\u7bb1\u4f1a\u8bdd\u9ed8\u8ba4\u4e3a <code>host<\/code>\u3002<\/li>\n<li>\u5982\u679c\u8fde\u63a5\u4e86\u5177\u6709\u6d4f\u89c8\u5668\u80fd\u529b\u7684\u8282\u70b9\uff0c\u5de5\u5177\u53ef\u80fd\u4f1a\u81ea\u52a8\u8def\u7531\u5230\u8be5\u8282\u70b9\uff0c\u9664\u975e\u4f60\u6307\u5b9a <code>target=\"host\"<\/code> \u6216 <code>target=\"node\"<\/code>\u3002<\/li>\n<\/ul>\n<p>\u8fd9\u4f7f\u667a\u80fd\u4f53\u4fdd\u6301\u786e\u5b9a\u6027\u5e76\u907f\u514d\u8106\u5f31\u7684\u9009\u62e9\u5668\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6d4f\u89c8\u5668\uff08OpenClaw \u6258\u7ba1\uff09 \u6d4f\u89c8\u5668\uff08openclaw \u6258\u7ba1\uff09 OpenClaw \u53ef\u4ee5\u8fd0\u884c\u4e00\u4e2a\u7531\u667a\u80fd\u4f53\u63a7\u5236 [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-276","post","type-post","status-publish","format-standard","hentry","category-docs"],"_links":{"self":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/276","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/comments?post=276"}],"version-history":[{"count":1,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/276\/revisions"}],"predecessor-version":[{"id":571,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/276\/revisions\/571"}],"wp:attachment":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/media?parent=276"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/categories?post=276"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/tags?post=276"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}