|
256 | 256 | footer a { color: var(--text-muted); } |
257 | 257 | footer a:hover { color: var(--text); } |
258 | 258 |
|
| 259 | + /* Code blocks with copy button */ |
| 260 | + .code-block { |
| 261 | + position: relative; |
| 262 | + margin: 12px 0; |
| 263 | + } |
| 264 | + |
| 265 | + .code-block pre { |
| 266 | + margin: 0; |
| 267 | + padding-right: 80px; |
| 268 | + } |
| 269 | + |
| 270 | + .copy-btn { |
| 271 | + position: absolute; |
| 272 | + top: 8px; |
| 273 | + right: 8px; |
| 274 | + background: var(--surface); |
| 275 | + border: 1px solid var(--border); |
| 276 | + color: var(--text-muted); |
| 277 | + border-radius: 6px; |
| 278 | + padding: 4px 10px; |
| 279 | + font-size: 12px; |
| 280 | + cursor: pointer; |
| 281 | + transition: all 0.2s; |
| 282 | + } |
| 283 | + |
| 284 | + .copy-btn:hover { |
| 285 | + border-color: var(--accent); |
| 286 | + color: var(--text); |
| 287 | + } |
| 288 | + |
| 289 | + .copy-btn.copied { |
| 290 | + border-color: var(--green); |
| 291 | + color: var(--green); |
| 292 | + } |
| 293 | + |
259 | 294 | /* Responsive */ |
260 | 295 | @media (max-width: 640px) { |
261 | 296 | .hero h1 { font-size: 32px; } |
|
272 | 307 | <div class="logo">flutter-skill</div> |
273 | 308 | <nav> |
274 | 309 | <a href="#getting-started">Getting Started</a> |
| 310 | + <a href="#browser-setup">Browser Setup</a> |
275 | 311 | <a href="#platforms">Platforms</a> |
276 | 312 | <a href="#cli">CLI Reference</a> |
277 | 313 | <a href="#ide-setup">IDE Setup</a> |
@@ -382,6 +418,133 @@ <h4><code>serve</code> — HTTP REST</h4> |
382 | 418 | </div> |
383 | 419 | </section> |
384 | 420 |
|
| 421 | + <!-- Browser Setup --> |
| 422 | + <section id="browser-setup"> |
| 423 | + <h2>Browser Setup</h2> |
| 424 | + <p>flutter-skill connects to any Chromium-based browser via CDP. Choose your browser and copy the commands.</p> |
| 425 | + |
| 426 | + <h3>🚀 Quick Start (Auto-launch)</h3> |
| 427 | + <p>flutter-skill can auto-launch a headless Chrome — zero setup required.</p> |
| 428 | + <div class="code-block"> |
| 429 | + <pre><span class="comment"># Auto-launches Chrome, opens the URL, starts the MCP server</span> |
| 430 | +flutter-skill serve https://your-app.com --port=3000</pre> |
| 431 | + <button class="copy-btn" onclick="copyCode(this, 'flutter-skill serve https://your-app.com --port=3000')">📋 Copy</button> |
| 432 | + </div> |
| 433 | + |
| 434 | + <h3>🌐 System Chrome</h3> |
| 435 | + <p>Use your regular Chrome with existing login sessions.</p> |
| 436 | + <div class="code-block"> |
| 437 | + <pre><span class="comment"># macOS</span> |
| 438 | +/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome \ |
| 439 | + --remote-debugging-port=9222 \ |
| 440 | + --user-data-dir=$HOME/.flutter-skill/chrome-profile</pre> |
| 441 | + <button class="copy-btn" onclick="copyCode(this, '/Applications/Google\\ Chrome.app/Contents/MacOS/Google\\ Chrome --remote-debugging-port=9222 --user-data-dir=$HOME/.flutter-skill/chrome-profile')">📋 Copy (macOS)</button> |
| 442 | + </div> |
| 443 | + <div class="code-block"> |
| 444 | + <pre><span class="comment"># Linux</span> |
| 445 | +google-chrome --remote-debugging-port=9222 \ |
| 446 | + --user-data-dir=$HOME/.flutter-skill/chrome-profile</pre> |
| 447 | + <button class="copy-btn" onclick="copyCode(this, 'google-chrome --remote-debugging-port=9222 --user-data-dir=$HOME/.flutter-skill/chrome-profile')">📋 Copy (Linux)</button> |
| 448 | + </div> |
| 449 | + <div class="code-block"> |
| 450 | + <pre><span class="comment"># Windows</span> |
| 451 | +"C:\Program Files\Google\Chrome\Application\chrome.exe" ^ |
| 452 | + --remote-debugging-port=9222 ^ |
| 453 | + --user-data-dir=%USERPROFILE%\.flutter-skill\chrome-profile</pre> |
| 454 | + <button class="copy-btn" onclick="copyCode(this, '"C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe" --remote-debugging-port=9222 --user-data-dir=%USERPROFILE%\\.flutter-skill\\chrome-profile')">📋 Copy (Windows)</button> |
| 455 | + </div> |
| 456 | + <p>Then connect flutter-skill:</p> |
| 457 | + <div class="code-block"> |
| 458 | + <pre>flutter-skill serve https://your-app.com --port=3000 --chrome-port=9222 --no-launch</pre> |
| 459 | + <button class="copy-btn" onclick="copyCode(this, 'flutter-skill serve https://your-app.com --port=3000 --chrome-port=9222 --no-launch')">📋 Copy</button> |
| 460 | + </div> |
| 461 | + |
| 462 | + <h3>🧪 Chrome for Testing (CfT)</h3> |
| 463 | + <p>Isolated Chrome build designed for automation. Recommended for CI/CD.</p> |
| 464 | + <div class="code-block"> |
| 465 | + <pre><span class="comment"># Install via npx</span> |
| 466 | +npx @anthropic-ai/cft install</pre> |
| 467 | + <button class="copy-btn" onclick="copyCode(this, 'npx @anthropic-ai/cft install')">📋 Copy</button> |
| 468 | + </div> |
| 469 | + <div class="code-block"> |
| 470 | + <pre><span class="comment"># Or download directly (macOS ARM64 example)</span> |
| 471 | +npx @anthropic-ai/cft install --platform=mac-arm64</pre> |
| 472 | + <button class="copy-btn" onclick="copyCode(this, 'npx @anthropic-ai/cft install --platform=mac-arm64')">📋 Copy</button> |
| 473 | + </div> |
| 474 | + |
| 475 | + <h3>🖥️ Microsoft Edge</h3> |
| 476 | + <p>Edge is Chromium-based and supports CDP.</p> |
| 477 | + <div class="code-block"> |
| 478 | + <pre><span class="comment"># macOS</span> |
| 479 | +/Applications/Microsoft\ Edge.app/Contents/MacOS/Microsoft\ Edge \ |
| 480 | + --remote-debugging-port=9222</pre> |
| 481 | + <button class="copy-btn" onclick="copyCode(this, '/Applications/Microsoft\\ Edge.app/Contents/MacOS/Microsoft\\ Edge --remote-debugging-port=9222')">📋 Copy (macOS)</button> |
| 482 | + </div> |
| 483 | + <div class="code-block"> |
| 484 | + <pre><span class="comment"># Windows</span> |
| 485 | +"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" ^ |
| 486 | + --remote-debugging-port=9222</pre> |
| 487 | + <button class="copy-btn" onclick="copyCode(this, '"C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe" --remote-debugging-port=9222')">📋 Copy (Windows)</button> |
| 488 | + </div> |
| 489 | + |
| 490 | + <h3>🦁 Brave Browser</h3> |
| 491 | + <div class="code-block"> |
| 492 | + <pre><span class="comment"># macOS</span> |
| 493 | +/Applications/Brave\ Browser.app/Contents/MacOS/Brave\ Browser \ |
| 494 | + --remote-debugging-port=9222</pre> |
| 495 | + <button class="copy-btn" onclick="copyCode(this, '/Applications/Brave\\ Browser.app/Contents/MacOS/Brave\\ Browser --remote-debugging-port=9222')">📋 Copy</button> |
| 496 | + </div> |
| 497 | + |
| 498 | + <h3>🐳 Docker (Headless)</h3> |
| 499 | + <p>For CI/CD and server environments.</p> |
| 500 | + <div class="code-block"> |
| 501 | + <pre><span class="comment"># Run headless Chrome in Docker</span> |
| 502 | +docker run -d --name chrome -p 9222:9222 \ |
| 503 | + zenika/alpine-chrome \ |
| 504 | + --no-sandbox --remote-debugging-address=0.0.0.0 \ |
| 505 | + --remote-debugging-port=9222</pre> |
| 506 | + <button class="copy-btn" onclick="copyCode(this, 'docker run -d --name chrome -p 9222:9222 zenika/alpine-chrome --no-sandbox --remote-debugging-address=0.0.0.0 --remote-debugging-port=9222')">📋 Copy</button> |
| 507 | + </div> |
| 508 | + <div class="code-block"> |
| 509 | + <pre><span class="comment"># Connect from host</span> |
| 510 | +flutter-skill serve https://your-app.com --chrome-port=9222 --no-launch</pre> |
| 511 | + <button class="copy-btn" onclick="copyCode(this, 'flutter-skill serve https://your-app.com --chrome-port=9222 --no-launch')">📋 Copy</button> |
| 512 | + </div> |
| 513 | + |
| 514 | + <h3>⚙️ Chrome Launch Options</h3> |
| 515 | + <table> |
| 516 | + <thead> |
| 517 | + <tr><th>Flag</th><th>Description</th></tr> |
| 518 | + </thead> |
| 519 | + <tbody> |
| 520 | + <tr><td><code>--remote-debugging-port=9222</code></td><td>Enable CDP on port 9222 (required)</td></tr> |
| 521 | + <tr><td><code>--user-data-dir=PATH</code></td><td>Persistent profile (keeps login sessions)</td></tr> |
| 522 | + <tr><td><code>--headless=new</code></td><td>Headless mode (no UI window)</td></tr> |
| 523 | + <tr><td><code>--no-sandbox</code></td><td>Required in Docker/CI</td></tr> |
| 524 | + <tr><td><code>--disable-gpu</code></td><td>Disable GPU acceleration (CI)</td></tr> |
| 525 | + <tr><td><code>--window-size=1920,1080</code></td><td>Set viewport size</td></tr> |
| 526 | + <tr><td><code>--proxy-server=host:port</code></td><td>Route through proxy</td></tr> |
| 527 | + <tr><td><code>--ignore-certificate-errors</code></td><td>Skip SSL verification</td></tr> |
| 528 | + </tbody> |
| 529 | + </table> |
| 530 | + |
| 531 | + <h3>🔗 flutter-skill serve Options</h3> |
| 532 | + <table> |
| 533 | + <thead> |
| 534 | + <tr><th>Flag</th><th>Default</th><th>Description</th></tr> |
| 535 | + </thead> |
| 536 | + <tbody> |
| 537 | + <tr><td><code>--port</code></td><td>3000</td><td>HTTP API port</td></tr> |
| 538 | + <tr><td><code>--chrome-port</code></td><td>9222</td><td>Chrome CDP port to connect to</td></tr> |
| 539 | + <tr><td><code>--no-launch</code></td><td>false</td><td>Don't auto-launch Chrome (connect to existing)</td></tr> |
| 540 | + <tr><td><code>--headless</code></td><td>false</td><td>Launch Chrome in headless mode</td></tr> |
| 541 | + <tr><td><code>--proxy</code></td><td>-</td><td>Proxy URL for Chrome</td></tr> |
| 542 | + <tr><td><code>--ignore-ssl</code></td><td>false</td><td>Ignore SSL certificate errors</td></tr> |
| 543 | + <tr><td><code>--max-tabs</code></td><td>5</td><td>Maximum open tabs</td></tr> |
| 544 | + </tbody> |
| 545 | + </table> |
| 546 | + </section> |
| 547 | + |
385 | 548 | <!-- CLI Reference --> |
386 | 549 | <section id="cli"> |
387 | 550 | <h2>CLI Client Reference</h2> |
@@ -515,5 +678,17 @@ <h4><a href="https://github.com/ai-dashboad/flutter-skill/blob/main/CHANGELOG.md |
515 | 678 | </div> |
516 | 679 | </footer> |
517 | 680 |
|
| 681 | +<script> |
| 682 | +function copyCode(btn, text) { |
| 683 | + navigator.clipboard.writeText(text).then(() => { |
| 684 | + btn.textContent = '✅ Copied!'; |
| 685 | + btn.classList.add('copied'); |
| 686 | + setTimeout(() => { |
| 687 | + btn.textContent = '📋 Copy'; |
| 688 | + btn.classList.remove('copied'); |
| 689 | + }, 2000); |
| 690 | + }); |
| 691 | +} |
| 692 | +</script> |
518 | 693 | </body> |
519 | 694 | </html> |
0 commit comments