{"skill":{"slug":"grok-browser","displayName":"Grok Browser","summary":"Query Grok AI via browser automation. Use when you need to ask Grok questions, get AI responses, or use Grok's DeepSearch/Think features. Copies response tex...","description":"---\nname: grok-browser\ndescription: Query Grok AI via browser automation. Use when you need to ask Grok questions, get AI responses, or use Grok's DeepSearch/Think features. Copies response text instead of using screenshots.\n---\n\n# Grok Browser Skill\n\nQuery Grok (grok.com) via Chrome browser automation and copy responses.\n\n## Prerequisites\n\n- Chrome with Browser Relay extension\n- Use `profile=chrome` (never `profile=clawd`)\n\n## Quick Start\n\n```bash\n# 1. Open Chrome with Grok\nopen -a \"Google Chrome\" \"https://grok.com\"\nsleep 3\n\n# 2. Attach browser relay\n/Users/eason/clawd/scripts/attach-browser-relay.sh\n\n# 3. Check tabs\nbrowser action=tabs profile=chrome\n```\n\n## Input Method (IMPORTANT!)\n\nGrok uses **contenteditable**, not a standard textbox. Use JavaScript evaluate:\n\n```javascript\n// Type query via evaluate\nbrowser action=act profile=chrome targetId=<id> request={\n  \"kind\": \"evaluate\",\n  \"fn\": \"(() => { const editor = document.querySelector('[contenteditable=\\\"true\\\"]'); if(editor) { editor.focus(); editor.innerText = 'YOUR_QUERY_HERE'; return 'typed'; } return 'not found'; })()\"\n}\n```\n\nThen submit with Enter:\n```\nbrowser action=act profile=chrome targetId=<id> request={\"kind\":\"press\",\"key\":\"Enter\"}\n```\n\n## Complete Workflow\n\n### 1. Open Grok & Attach Relay\n\n```bash\nopen -a \"Google Chrome\" \"https://grok.com\"\nsleep 3\n/Users/eason/clawd/scripts/attach-browser-relay.sh\n```\n\n### 2. Get Tab ID\n\n```\nbrowser action=tabs profile=chrome\n```\n\nLook for Grok tab, note the `targetId`.\n\n### 3. Input Query\n\n```\nbrowser action=act profile=chrome targetId=<id> request={\n  \"kind\": \"evaluate\",\n  \"fn\": \"(() => { const e = document.querySelector('[contenteditable=\\\"true\\\"]'); if(e) { e.focus(); e.innerText = 'What is quantum computing?'; return 'ok'; } return 'fail'; })()\"\n}\n```\n\n### 4. Submit\n\n```\nbrowser action=act profile=chrome targetId=<id> request={\"kind\":\"press\",\"key\":\"Enter\"}\n```\n\n### 5. Wait for Response\n\n```bash\nsleep 10-20  # Grok can take 10-30 seconds\n```\n\n### 6. Snapshot & Find Copy Button\n\n```\nbrowser action=snapshot profile=chrome targetId=<id>\n```\n\nLook for button with \"Copy\" in the response area (usually last message).\n\n### 7. Click Copy\n\n```\nbrowser action=act profile=chrome targetId=<id> request={\"kind\":\"click\",\"ref\":\"<copy_button_ref>\"}\n```\n\n### 8. Read Clipboard\n\n```bash\npbpaste\n```\n\n## Response Detection\n\nAfter submitting, response is complete when:\n- Copy button appears below the response text\n- Response time indicator shows (e.g., \"952ms\")\n- Suggested follow-up buttons appear\n\n## New Chat for New Topics\n\nAlways start fresh chats for unrelated queries to avoid context overflow:\n\n```\nbrowser action=navigate profile=chrome targetId=<id> targetUrl=\"https://grok.com\"\n```\n\nOr use Cmd+J shortcut:\n```\nbrowser action=act profile=chrome targetId=<id> request={\"kind\":\"press\",\"key\":\"Meta+j\"}\n```\n\n## DeepSearch\n\nTo enable DeepSearch, click the button before submitting:\n```\n# In snapshot, find DeepSearch button\nbrowser action=act profile=chrome targetId=<id> request={\"kind\":\"click\",\"ref\":\"<deepsearch_ref>\"}\n# Then type and submit as normal\n```\n\n## Troubleshooting\n\n### Tab Not Found\nRe-run attach script:\n```bash\n/Users/eason/clawd/scripts/attach-browser-relay.sh\n```\n\n### Relay Not Working\nCheck status:\n```\nbrowser action=status profile=chrome\n```\nShould show `cdpReady: true`.\n\n### Context Overflow\nNavigate to fresh grok.com, don't continue old chats.\n\n### Multiple Windows\nClose extra Chrome windows. Keep only one for reliable relay.\n\n### Copy Button Not Found\nResponse may still be streaming. Wait longer and snapshot again.\n\n## Example Session\n\n```\n# Open and attach\nexec: open -a \"Google Chrome\" \"https://grok.com\"\nexec: sleep 3\nexec: /Users/eason/clawd/scripts/attach-browser-relay.sh\n\n# Get tab\nbrowser action=tabs profile=chrome\n# Returns targetId: ABC123...\n\n# Type query\nbrowser action=act profile=chrome targetId=ABC123 request={\n  \"kind\":\"evaluate\",\n  \"fn\":\"(() => { const e = document.querySelector('[contenteditable=\\\"true\\\"]'); e.focus(); e.innerText = 'Explain quantum entanglement briefly'; return 'ok'; })()\"\n}\n\n# Submit\nbrowser action=act profile=chrome targetId=ABC123 request={\"kind\":\"press\",\"key\":\"Enter\"}\n\n# Wait\nexec: sleep 15\n\n# Snapshot to find Copy button\nbrowser action=snapshot profile=chrome targetId=ABC123\n# Find Copy button ref, e.g., e326\n\n# Copy\nbrowser action=act profile=chrome targetId=ABC123 request={\"kind\":\"click\",\"ref\":\"e326\"}\n\n# Read result\nexec: pbpaste\n```\n","topics":["Browser Automation"],"tags":{"latest":"1.0.0"},"stats":{"comments":0,"downloads":1394,"installsAllTime":52,"installsCurrent":0,"stars":0,"versions":1},"createdAt":1771175748655,"updatedAt":1778990760685},"latestVersion":{"version":"1.0.0","createdAt":1771175748655,"changelog":"Initial publish","license":null},"metadata":null,"owner":{"handle":"easonc13","userId":"s17fkwdq9n4cahgs1jfqas4avx884bwy","displayName":"Eason Chen","image":"https://avatars.githubusercontent.com/u/43432631?v=4"},"moderation":{"isSuspicious":false,"isMalwareBlocked":false,"verdict":"clean","reasonCodes":["review.llm_review"],"summary":"Review: review.llm_review","engineVersion":"v2.4.24","updatedAt":1779968351749}}