[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M777E044E1S1XFD5DJHRE19N":3,"skill-same:01M777E044E1S1XFD5DJHRE19N":47},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":6,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M777E044E1S1XFD5DJHRE19N","claude-for-safari",null,"Control the user's real Safari browser on macOS using AppleScript and screencapture. This skill should be used when the user asks to interact with Safari, browse websites, read web pages, automate browser tasks, take screenshots of web content, or when any task would benefit from seeing or interacting with what's in their browser. Triggers on keywords like \"safari\", \"browser\", \"web page\", \"open tab\", \"screenshot the page\", \"read this site\", \"browse\", \"click on\", \"fill in the form\".","Lord1Egypt\u002Fawesome-skill-forge","Lord1Egypt","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F99746359?v=4","01M7592YDNT0XK9WJ0T2MQVPDN","Mohamed Mounir Ali AL Keshita","01M75GRFNHC8VZNWEB8DKDE433",3,"MIT","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fcommunity\u002Fclawhub\u002Fc\u002Fclaude-for-safari\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: claude-for-safari\ndescription: Control the user's real Safari browser on macOS using AppleScript and screencapture. This skill should be used when the user asks to interact with Safari, browse websites, read web pages, automate browser tasks, take screenshots of web content, or when any task would benefit from seeing or interacting with what's in their browser. Triggers on keywords like \"safari\", \"browser\", \"web page\", \"open tab\", \"screenshot the page\", \"read this site\", \"browse\", \"click on\", \"fill in the form\".\n---\n\n# Claude for Safari\n\nOperate the user's real Safari browser on macOS via AppleScript (`osascript`) and `screencapture`. This provides full access to the user's actual browser session — including login state, cookies, and open tabs — without any extensions or additional software.\n\n## Prerequisites\n\nBefore first use, verify two settings are enabled. Run this check at the start of every session:\n\n```bash\nosascript -e 'tell application \"Safari\" to get name of front window' 2>&1\n```\n\nIf this fails, instruct the user to enable:\n1. **System Settings > Privacy & Security > Automation** — grant terminal app permission to control Safari\n2. **Safari > Settings > Advanced** — enable \"Show features for web developers\", then **Develop menu > Allow JavaScript from Apple Events**\n\n## Core Capabilities\n\n### 1. List All Open Tabs\n\n```bash\nosascript -e '\ntell application \"Safari\"\n  set output to \"\"\n  repeat with w from 1 to (count of windows)\n    repeat with t from 1 to (count of tabs of window w)\n      set tabName to name of tab t of window w\n      set tabURL to URL of tab t of window w\n      set output to output & \"W\" & w & \"T\" & t & \" | \" & tabName & \" | \" & tabURL & linefeed\n    end repeat\n  end repeat\n  return output\nend tell'\n```\n\n### 2. Read Page Content\n\nRead the full text content of the current tab:\n\n```bash\nosascript -e '\ntell application \"Safari\"\n  do JavaScript \"document.body.innerText\" in current tab of front window\nend tell'\n```\n\nRead structured content (title, URL, meta description, headings):\n\n```bash\nosascript -e '\ntell application \"Safari\"\n  do JavaScript \"JSON.stringify({\n    title: document.title,\n    url: location.href,\n    description: document.querySelector(\\\"meta[name=description]\\\")?.content || \\\"\\\",\n    h1: [...document.querySelectorAll(\\\"h1\\\")].map(e => e.textContent).join(\\\" | \\\"),\n    h2: [...document.querySelectorAll(\\\"h2\\\")].map(e => e.textContent).join(\\\" | \\\")\n  })\" in current tab of front window\nend tell'\n```\n\nRead a simplified DOM (similar to Chrome ACP's `browser_read`):\n\n```bash\nosascript -e '\ntell application \"Safari\"\n  do JavaScript \"\n    (function() {\n      const walk = (node, depth) => {\n        let result = \\\"\\\";\n        for (const child of node.childNodes) {\n          if (child.nodeType === 3) {\n            const text = child.textContent.trim();\n            if (text) result += text + \\\"\\\\n\\\";\n          } else if (child.nodeType === 1) {\n            const tag = child.tagName.toLowerCase();\n            if ([\\\"script\\\",\\\"style\\\",\\\"noscript\\\",\\\"svg\\\"].includes(tag)) continue;\n            const style = getComputedStyle(child);\n            if (style.display === \\\"none\\\" || style.visibility === \\\"hidden\\\") continue;\n            if ([\\\"h1\\\",\\\"h2\\\",\\\"h3\\\",\\\"h4\\\",\\\"h5\\\",\\\"h6\\\"].includes(tag))\n              result += \\\"#\\\".repeat(parseInt(tag[1])) + \\\" \\\";\n            if (tag === \\\"a\\\") result += \\\"[\\\";\n            if (tag === \\\"img\\\") result += \\\"[Image: \\\" + (child.alt || \\\"\\\") + \\\"]\\\\n\\\";\n            else if (tag === \\\"input\\\") result += \\\"[Input \\\" + child.type + \\\": \\\" + (child.value || child.placeholder || \\\"\\\") + \\\"]\\\\n\\\";\n            else if (tag === \\\"button\\\") result += \\\"[Button: \\\" + child.textContent.trim() + \\\"]\\\\n\\\";\n            else result += walk(child, depth + 1);\n            if (tag === \\\"a\\\") result += \\\"](\\\" + child.href + \\\")\\\\n\\\";\n            if ([\\\"p\\\",\\\"div\\\",\\\"li\\\",\\\"tr\\\",\\\"br\\\",\\\"h1\\\",\\\"h2\\\",\\\"h3\\\",\\\"h4\\\",\\\"h5\\\",\\\"h6\\\"].includes(tag))\n              result += \\\"\\\\n\\\";\n          }\n        }\n        return result;\n      };\n      return walk(document.body, 0).substring(0, 50000);\n    })()\n  \" in current tab of front window\nend tell'\n```\n\n### 3. Execute JavaScript\n\nRun arbitrary JavaScript in the page context and get the return value:\n\n```bash\nosascript -e '\ntell application \"Safari\"\n  do JavaScript \"YOUR_JS_CODE_HERE\" in current tab of front window\nend tell'\n```\n\nFor multi-line scripts, use a heredoc:\n\n```bash\nosascript \u003C\u003C 'APPLESCRIPT'\ntell application \"Safari\"\n  do JavaScript \"\n    (function() {\n      \u002F\u002F Multi-line JS here\n      return 'result';\n    })()\n  \" in current tab of front window\nend tell\nAPPLESCRIPT\n```\n\n### 4. Screenshot\n\nTwo approaches are available. Auto-detect which to use at session start:\n\n```bash\n# Test if Screen Recording permission is granted (background screenshot available)\n\u002Ftmp\u002Fsafari_wid 2>\u002Fdev\u002Fnull && echo \"BACKGROUND_SCREENSHOT=true\" || echo \"BACKGROUND_SCREENSHOT=false\"\n```\n\n#### Background Screenshot (requires Screen Recording permission)\n\nIf the user has granted Screen Recording permission to the terminal app, use `screencapture -l` to capture Safari **without activating it**:\n\n```bash\n# Compile the helper once per session (if not already compiled)\nif [ ! -f \u002Ftmp\u002Fsafari_wid ]; then\ncat > \u002Ftmp\u002Fsafari_wid.swift \u003C\u003C 'SWIFT'\nimport CoreGraphics\nimport Foundation\nlet options: CGWindowListOption = [.optionOnScreenOnly, .excludeDesktopElements]\nguard let windowList = CGWindowListCopyWindowInfo(options, kCGNullWindowID) as? [[String: Any]] else { exit(1) }\nfor window in windowList {\n    guard let owner = window[kCGWindowOwnerName as String] as? String,\n          owner == \"Safari\",\n          let layer = window[kCGWindowLayer as String] as? Int,\n          layer == 0,\n          let wid = window[kCGWindowNumber as String] as? Int else { continue }\n    print(wid)\n    exit(0)\n}\nexit(1)\nSWIFT\nswiftc \u002Ftmp\u002Fsafari_wid.swift -o \u002Ftmp\u002Fsafari_wid\nfi\n\n# Capture Safari window in background (no activation needed)\nWID=$(\u002Ftmp\u002Fsafari_wid)\nscreencapture -l \"$WID\" -o -x \u002Ftmp\u002Fsafari_screenshot.png\n```\n\nTo enable this, instruct the user: **System Settings > Privacy & Security > Screen Recording** — grant permission to the terminal app (Terminal \u002F iTerm \u002F Warp).\n\n#### Foreground Screenshot (no extra permissions needed)\n\nIf Screen Recording is not granted, fall back to region-based capture. This briefly activates Safari (~0.5s), then switches back:\n\n```bash\n# Remember current frontmost app\nFRONT_APP=$(osascript -e 'tell application \"System Events\" to get name of first process whose frontmost is true')\n\n# Activate Safari and capture its window region\nosascript -e 'tell application \"Safari\" to activate'\nsleep 0.3\nBOUNDS=$(osascript -e '\ntell application \"System Events\"\n  tell process \"Safari\"\n    -- Safari may expose a thin toolbar as window 1; find the largest window\n    set bestW to 0\n    set bestBounds to \"\"\n    repeat with i from 1 to (count of windows)\n      set {x, y} to position of window i\n      set {w, h} to size of window i\n      if w * h > bestW then\n        set bestW to w * h\n        set bestBounds to (x as text) & \",\" & (y as text) & \",\" & (w as text) & \",\" & (h as text)\n      end if\n    end repeat\n    return bestBounds\n  end tell\nend tell')\nscreencapture -x -R \"$BOUNDS\" \u002Ftmp\u002Fsafari_screenshot.png\n\n# Switch back to the previous app\nosascript -e \"tell application \\\"$FRONT_APP\\\" to activate\"\n```\n\nAfter capturing with either method, read the screenshot to see what's on screen:\n\n```\nUse the Read tool on \u002Ftmp\u002Fsafari_screenshot.png to view the captured image.\n```\n\n### 5. Navigate\n\nOpen a URL in the current tab:\n\n```bash\nosascript -e '\ntell application \"Safari\"\n  set URL of current tab of front window to \"https:\u002F\u002Fexample.com\"\nend tell'\n```\n\nOpen a URL in a new tab:\n\n```bash\nosascript -e '\ntell application \"Safari\"\n  tell front window\n    set newTab to make new tab with properties {URL:\"https:\u002F\u002Fexample.com\"}\n    set current tab to newTab\n  end tell\nend tell'\n```\n\nOpen a URL in a new window:\n\n```bash\nosascript -e 'tell application \"Safari\" to make new document with properties {URL:\"https:\u002F\u002Fexample.com\"}'\n```\n\n### 6. Click Elements\n\nClick using JavaScript (preferred — works with SPAs and reactive frameworks):\n\n```bash\nosascript -e '\ntell application \"Safari\"\n  do JavaScript \"\n    const el = document.querySelector(\\\"button.submit\\\");\n    if (el) {\n      el.dispatchEvent(new MouseEvent(\\\"click\\\", {bubbles: true, cancelable: true}));\n      \\\"clicked\\\";\n    } else {\n      \\\"element not found\\\";\n    }\n  \" in current tab of front window\nend tell'\n```\n\n**Important**: Use `dispatchEvent(new MouseEvent(..., {bubbles: true}))` instead of `.click()` for React\u002FVue\u002FAngular compatibility. Native `.click()` may bypass synthetic event handlers.\n\n### 7. Type and Fill Forms\n\nSet input values via JavaScript:\n\n```bash\nosascript -e '\ntell application \"Safari\"\n  do JavaScript \"\n    const input = document.querySelector(\\\"input[name=search]\\\");\n    const nativeSetter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, \\\"value\\\").set;\n    nativeSetter.call(input, \\\"search text\\\");\n    input.dispatchEvent(new Event(\\\"input\\\", {bubbles: true}));\n    input.dispatchEvent(new Event(\\\"change\\\", {bubbles: true}));\n  \" in current tab of front window\nend tell'\n```\n\n**Important**: For React-controlled inputs, use the native setter + `dispatchEvent` pattern shown above. Directly setting `.value` will not trigger React's state update.\n\nType via System Events (simulates real keyboard — useful when JS injection is blocked):\n\n```bash\nosascript -e '\ntell application \"Safari\" to activate\ndelay 0.3\ntell application \"System Events\"\n  keystroke \"hello world\"\nend tell'\n```\n\nPress special keys:\n\n```bash\nosascript -e '\ntell application \"System Events\"\n  key code 36  -- Enter\u002FReturn\n  key code 48  -- Tab\n  key code 51  -- Delete\u002FBackspace\n  keystroke \"a\" using command down  -- Cmd+A (select all)\n  keystroke \"c\" using command down  -- Cmd+C (copy)\nend tell'\n```\n\n### 8. Scroll\n\n```bash\n# Scroll down 500px\nosascript -e 'tell application \"Safari\" to do JavaScript \"window.scrollBy(0, 500)\" in current tab of front window'\n\n# Scroll to top\nosascript -e 'tell application \"Safari\" to do JavaScript \"window.scrollTo(0, 0)\" in current tab of front window'\n\n# Scroll to bottom\nosascript -e 'tell application \"Safari\" to do JavaScript \"window.scrollTo(0, document.body.scrollHeight)\" in current tab of front window'\n\n# Scroll element into view\nosascript -e 'tell application \"Safari\" to do JavaScript \"document.querySelector(\\\"#target\\\").scrollIntoView({behavior: \\\"smooth\\\"})\" in current tab of front window'\n```\n\n### 9. Switch Tabs\n\n```bash\n# Switch to tab 2 in the front window\nosascript -e 'tell application \"Safari\" to set current tab of front window to tab 2 of front window'\n\n# Switch to a tab by URL match\nosascript -e '\ntell application \"Safari\"\n  repeat with t from 1 to (count of tabs of front window)\n    if URL of tab t of front window contains \"github.com\" then\n      set current tab of front window to tab t of front window\n      exit repeat\n    end if\n  end repeat\nend tell'\n```\n\n### 10. Wait for Page Load\n\n```bash\nosascript -e '\ntell application \"Safari\"\n  -- Wait until page finishes loading (max 10 seconds)\n  repeat 20 times\n    set readyState to do JavaScript \"document.readyState\" in current tab of front window\n    if readyState is \"complete\" then exit repeat\n    delay 0.5\n  end repeat\nend tell'\n```\n\n## Workflow: Browsing with Screenshot Feedback Loop\n\nFor tasks that require visual confirmation, use the screenshot loop:\n\n1. Perform action (navigate, click, scroll, etc.)\n2. Wait for page load if needed\n3. Take screenshot (background or foreground) → Read the image to see result\n4. Decide next action based on what is visible\n\n## Operating on Specific Tabs\n\nTo operate on a tab other than the current one, use `tab N of window M` syntax:\n\n```bash\n# Read content of tab 3 in window 1\nosascript -e 'tell application \"Safari\" to do JavaScript \"document.title\" in tab 3 of window 1'\n\n# Execute JS in a specific tab\nosascript -e 'tell application \"Safari\" to do JavaScript \"document.body.innerText.substring(0, 1000)\" in tab 2 of front window'\n```\n\nNote: Background screenshots capture the entire Safari window (whichever tab is active). To screenshot a specific tab, first switch to it via AppleScript.\n\n## Limitations\n\n- **macOS only** — AppleScript and screencapture are macOS-specific\n- **Cannot intercept network requests** — only page content and JS execution\n- **Cannot access cross-origin iframes** — browser security applies\n- **Private browsing windows** — AppleScript cannot control private windows\n- **System Events keystroke is \"blind\"** — it types into whatever is focused; ensure Safari is frontmost before using\n","# Claude for Safari\n\nOperate the user's real Safari browser on macOS via AppleScript (`osascript`) and `screencapture`. This provides full access to the user's actual browser session — including login state, cookies, and open tabs — without any extensions or additional software.\n\n## Prerequisites\n\nBefore first use, verify two settings are enabled. Run this check at the start of every session:\n\n```bash\nosascript -e 'tell application \"Safari\" to get name of front window' 2>&1\n```\n\nIf this fails, instruct the user to enable:\n1. **System Settings > Privacy & Security > Automation** — grant terminal app permission to control Safari\n2. **Safari > Settings > Advanced** — enable \"Show features for web developers\", then **Develop menu > Allow JavaScript from Apple Events**\n\n## Core Capabilities\n\n### 1. List All Open Tabs\n\n```bash\nosascript -e '\ntell application \"Safari\"\n  set output to \"\"\n  repeat with w from 1 to (count of windows)\n    repeat with t from 1 to (count of tabs of window w)\n      set tabName to name of tab t of window w\n      set tabURL to URL of tab t of window w\n      set output to output & \"W\" & w & \"T\" & t & \" | \" & tabName & \" | \" & tabURL & linefeed\n    end repeat\n  end repeat\n  return output\nend tell'\n```\n\n### 2. Read Page Content\n\nRead the full text content of the current tab:\n\n```bash\nosascript -e '\ntell application \"Safari\"\n  do JavaScript \"document.body.innerText\" in current tab of front window\nend tell'\n```\n\nRead structured content (title, URL, meta description, headings):\n\n```bash\nosascript -e '\ntell application \"Safari\"\n  do JavaScript \"JSON.stringify({\n    title: document.title,\n    url: location.href,\n    description: document.querySelector(\\\"meta[name=description]\\\")?.content || \\\"\\\",\n    h1: [...document.querySelectorAll(\\\"h1\\\")].map(e => e.textContent).join(\\\" | \\\"),\n    h2: [...document.querySelectorAll(\\\"h2\\\")].map(e => e.textContent).join(\\\" | \\\")\n  })\" in current tab of front window\nend tell'\n```\n\nRead a simplified DOM (similar to Chrome ACP's `browser_read`):\n\n```bash\nosascript -e '\ntell application \"Safari\"\n  do JavaScript \"\n    (function() {\n      const walk = (node, depth) => {\n        let result = \\\"\\\";\n        for (const child of node.childNodes) {\n          if (child.nodeType === 3) {\n            const text = child.textContent.trim();\n            if (text) result += text + \\\"\\\\n\\\";\n          } else if (child.nodeType === 1) {\n            const tag = child.tagName.toLowerCase();\n            if ([\\\"script\\\",\\\"style\\\",\\\"noscript\\\",\\\"svg\\\"].includes(tag)) continue;\n            const style = getComputedStyle(child);\n            if (style.display === \\\"none\\\" || style.visibility === \\\"hidden\\\") continue;\n            if ([\\\"h1\\\",\\\"h2\\\",\\\"h3\\\",\\\"h4\\\",\\\"h5\\\",\\\"h6\\\"].includes(tag))\n              result += \\\"#\\\".repeat(parseInt(tag[1])) + \\\" \\\";\n            if (tag === \\\"a\\\") result += \\\"[\\\";\n            if (tag === \\\"img\\\") result += \\\"[Image: \\\" + (child.alt || \\\"\\\") + \\\"]\\\\n\\\";\n            else if (tag === \\\"input\\\") result += \\\"[Input \\\" + child.type + \\\": \\\" + (child.value || child.placeholder || \\\"\\\") + \\\"]\\\\n\\\";\n            else if (tag === \\\"button\\\") result += \\\"[Button: \\\" + child.textContent.trim() + \\\"]\\\\n\\\";\n            else result += walk(child, depth + 1);\n            if (tag === \\\"a\\\") result += \\\"](\\\" + child.href + \\\")\\\\n\\\";\n            if ([\\\"p\\\",\\\"div\\\",\\\"li\\\",\\\"tr\\\",\\\"br\\\",\\\"h1\\\",\\\"h2\\\",\\\"h3\\\",\\\"h4\\\",\\\"h5\\\",\\\"h6\\\"].includes(tag))\n              result += \\\"\\\\n\\\";\n          }\n        }\n        return result;\n      };\n      return walk(document.body, 0).substring(0, 50000);\n    })()\n  \" in current tab of front window\nend tell'\n```\n\n### 3. Execute JavaScript\n\nRun arbitrary JavaScript in the page context and get the return value:\n\n```bash\nosascript -e '\ntell application \"Safari\"\n  do JavaScript \"YOUR_JS_CODE_HERE\" in current tab of front window\nend tell'\n```\n\nFor multi-line scripts, use a heredoc:\n\n```bash\nosascript \u003C\u003C 'APPLESCRIPT'\ntell application \"Safari\"\n  do JavaScript \"\n    (function() {\n      \u002F\u002F Multi-line JS here\n      return 'result';\n    })()\n  \" in current tab of front window\nend tell\nAPPLESCRIPT\n```\n\n### 4. Screenshot\n\nTwo approaches are available. Auto-detect which to use at session start:\n\n```bash\n# Test if Screen Recording permission is granted (background screenshot available)\n\u002Ftmp\u002Fsafari_wid 2>\u002Fdev\u002Fnull && echo \"BACKGROUND_SCREENSHOT=true\" || echo \"BACKGROUND_SCREENSHOT=false\"\n```\n\n#### Background Screenshot (requires Screen Recording permission)\n\nIf the user has granted Screen Recording permission to the terminal app, use `screencapture -l` to capture Safari **without activating it**:\n\n```bash\n# Compile the helper once per session (if not already compiled)\nif [ ! -f \u002Ftmp\u002Fsafari_wid ]; then\ncat > \u002Ftmp\u002Fsafari_wid.swift \u003C\u003C 'SWIFT'\nimport CoreGraphics\nimport Foundation\nlet options: CGWindowListOption = [.optionOnScreenOnly, .excludeDesktopElements]\nguard let windowList = CGWindowListCopyWindowInfo(options, kCGNullWindowID) as? [[String: Any]] else { exit(1) }\nfor window in windowList {\n    guard let owner = window[kCGWindowOwnerName as String] as? String,\n          owner == \"Safari\",\n          let layer = window[kCGWindowLayer as String] as? Int,\n          layer == 0,\n          let wid = window[kCGWindowNumber as String] as? Int else { continue }\n    print(wid)\n    exit(0)\n}\nexit(1)\nSWIFT\nswiftc \u002Ftmp\u002Fsafari_wid.swift -o \u002Ftmp\u002Fsafari_wid\nfi\n\n# Capture Safari window in background (no activation needed)\nWID=$(\u002Ftmp\u002Fsafari_wid)\nscreencapture -l \"$WID\" -o -x \u002Ftmp\u002Fsafari_screenshot.png\n```\n\nTo enable this, instruct the user: **System Settings > Privacy & Security > Screen Recording** — grant permission to the terminal app (Terminal \u002F iTerm \u002F Warp).\n\n#### Foreground Screenshot (no extra permissions needed)\n\nIf Screen Recording is not granted, fall back to region-based capture. This briefly activates Safari (~0.5s), then switches back:\n\n```bash\n# Remember current frontmost app\nFRONT_APP=$(osascript -e 'tell application \"System Events\" to get name of first process whose frontmost is true')\n\n# Activate Safari and capture its window region\nosascript -e 'tell application \"Safari\" to activate'\nsleep 0.3\nBOUNDS=$(osascript -e '\ntell application \"System Events\"\n  tell process \"Safari\"\n    -- Safari may expose a thin toolbar as window 1; find the largest window\n    set bestW to 0\n    set bestBounds to \"\"\n    repeat with i from 1 to (count of windows)\n      set {x, y} to position of window i\n      set {w, h} to size of window i\n      if w * h > bestW then\n        set bestW to w * h\n        set bestBounds to (x as text) & \",\" & (y as text) & \",\" & (w as text) & \",\" & (h as text)\n      end if\n    end repeat\n    return bestBounds\n  end tell\nend tell')\nscreencapture -x -R \"$BOUNDS\" \u002Ftmp\u002Fsafari_screenshot.png\n\n# Switch back to the previous app\nosascript -e \"tell application \\\"$FRONT_APP\\\" to activate\"\n```\n\nAfter capturing with either method, read the screenshot to see what's on screen:\n\n```\nUse the Read tool on \u002Ftmp\u002Fsafari_screenshot.png to view the captured image.\n```\n\n### 5. Navigate\n\nOpen a URL in the current tab:\n\n```bash\nosascript -e '\ntell application \"Safari\"\n  set URL of current tab of front window to \"https:\u002F\u002Fexample.com\"\nend tell'\n```\n\nOpen a URL in a new tab:\n\n```bash\nosascript -e '\ntell application \"Safari\"\n  tell front window\n    set newTab to make new tab with properties {URL:\"https:\u002F\u002Fexample.com\"}\n    set current tab to newTab\n  end tell\nend tell'\n```\n\nOpen a URL in a new window:\n\n```bash\nosascript -e 'tell application \"Safari\" to make new document with properties {URL:\"https:\u002F\u002Fexample.com\"}'\n```\n\n### 6. Click Elements\n\nClick using JavaScript (preferred — works with SPAs and reactive frameworks):\n\n```bash\nosascript -e '\ntell application \"Safari\"\n  do JavaScript \"\n    const el = document.querySelector(\\\"button.submit\\\");\n    if (el) {\n      el.dispatchEvent(new MouseEvent(\\\"click\\\", {bubbles: true, cancelable: true}));\n      \\\"clicked\\\";\n    } else {\n      \\\"element not found\\\";\n    }\n  \" in current tab of front window\nend tell'\n```\n\n**Important**: Use `dispatchEvent(new MouseEvent(..., {bubbles: true}))` instead of `.click()` for React\u002FVue\u002FAngular compatibility. Native `.click()` may bypass synthetic event handlers.\n\n### 7. Type and Fill Forms\n\nSet input values via JavaScript:\n\n```bash\nosascript -e '\ntell application \"Safari\"\n  do JavaScript \"\n    const input = document.querySelector(\\\"input[name=search]\\\");\n    const nativeSetter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, \\\"value\\\").set;\n    nativeSetter.call(input, \\\"search text\\\");\n    input.dispatchEvent(new Event(\\\"input\\\", {bubbles: true}));\n    input.dispatchEvent(new Event(\\\"change\\\", {bubbles: true}));\n  \" in current tab of front window\nend tell'\n```\n\n**Important**: For React-controlled inputs, use the native setter + `dispatchEvent` pattern shown above. Directly setting `.value` will not trigger React's state update.\n\nType via System Events (simulates real keyboard — useful when JS injection is blocked):\n\n```bash\nosascript -e '\ntell application \"Safari\" to activate\ndelay 0.3\ntell application \"System Events\"\n  keystroke \"hello world\"\nend tell'\n```\n\nPress special keys:\n\n```bash\nosascript -e '\ntell application \"System Events\"\n  key code 36  -- Enter\u002FReturn\n  key code 48  -- Tab\n  key code 51  -- Delete\u002FBackspace\n  keystroke \"a\" using command down  -- Cmd+A (select all)\n  keystroke \"c\" using command down  -- Cmd+C (copy)\nend tell'\n```\n\n### 8. Scroll\n\n```bash\n# Scroll down 500px\nosascript -e 'tell application \"Safari\" to do JavaScript \"window.scrollBy(0, 500)\" in current tab of front window'\n\n# Scroll to top\nosascript -e 'tell application \"Safari\" to do JavaScript \"window.scrollTo(0, 0)\" in current tab of front window'\n\n# Scroll to bottom\nosascript -e 'tell application \"Safari\" to do JavaScript \"window.scrollTo(0, document.body.scrollHeight)\" in current tab of front window'\n\n# Scroll element into view\nosascript -e 'tell application \"Safari\" to do JavaScript \"document.querySelector(\\\"#target\\\").scrollIntoView({behavior: \\\"smooth\\\"})\" in current tab of front window'\n```\n\n### 9. Switch Tabs\n\n```bash\n# Switch to tab 2 in the front window\nosascript -e 'tell application \"Safari\" to set current tab of front window to tab 2 of front window'\n\n# Switch to a tab by URL match\nosascript -e '\ntell application \"Safari\"\n  repeat with t from 1 to (count of tabs of front window)\n    if URL of tab t of front window contains \"github.com\" then\n      set current tab of front window to tab t of front window\n      exit repeat\n    end if\n  end repeat\nend tell'\n```\n\n### 10. Wait for Page Load\n\n```bash\nosascript -e '\ntell application \"Safari\"\n  -- Wait until page finishes loading (max 10 seconds)\n  repeat 20 times\n    set readyState to do JavaScript \"document.readyState\" in current tab of front window\n    if readyState is \"complete\" then exit repeat\n    delay 0.5\n  end repeat\nend tell'\n```\n\n## Workflow: Browsing with Screenshot Feedback Loop\n\nFor tasks that require visual confirmation, use the screenshot loop:\n\n1. Perform action (navigate, click, scroll, etc.)\n2. Wait for page load if needed\n3. Take screenshot (background or foreground) → Read the image to see result\n4. Decide next action based on what is visible\n\n## Operating on Specific Tabs\n\nTo operate on a tab other than the current one, use `tab N of window M` syntax:\n\n```bash\n# Read content of tab 3 in window 1\nosascript -e 'tell application \"Safari\" to do JavaScript \"document.title\" in tab 3 of window 1'\n\n# Execute JS in a specific tab\nosascript -e 'tell application \"Safari\" to do JavaScript \"document.body.innerText.substring(0, 1000)\" in tab 2 of front window'\n```\n\nNote: Background screenshots capture the entire Safari window (whichever tab is active). To screenshot a specific tab, first switch to it via AppleScript.\n\n## Limitations\n\n- **macOS only** — AppleScript and screencapture are macOS-specific\n- **Cannot intercept network requests** — only page content and JS execution\n- **Cannot access cross-origin iframes** — browser security applies\n- **Private browsing windows** — AppleScript cannot control private windows\n- **System Events keystroke is \"blind\"** — it types into whatever is focused; ensure Safari is frontmost before using\n",{"name":5,"description":7},"master","4aa004da461d820f4ea5499e58eb8d196cf99016","community\u002Fclawhub\u002Fc\u002Fclaude-for-safari",0,"https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge","https:\u002F\u002Fskill-explorer-rho.vercel.app","https:\u002F\u002Fgithub.com\u002FLord1Egypt","Unbreakable. Unstoppable. Unmatched⚡.\r\n Speaker of machine tongues 🤖  | World-builder of decentralized dreams 🌐 | Defender of the digital realm🛡️.","2026-06-10 08:21:01",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add Lord1Egypt\u002Fawesome-skill-forge --skill claude-for-safari",{"tool":39,"command":40},"bunx","bunx skills add Lord1Egypt\u002Fawesome-skill-forge --skill claude-for-safari",{"tool":42,"command":43},"pnpm","pnpm dlx skills add Lord1Egypt\u002Fawesome-skill-forge --skill claude-for-safari","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fcommunity\u002Fclawhub\u002Fc\u002Fclaude-for-safari\u002FSKILL.md",true,[],[48,55,62,69,76,83],{"skillNo":49,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":19},"01M785WKJB99G3STR1NF9NRTJW","youtube-content","YouTube transcripts to summaries, threads, blogs.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fyoutube-content\u002FSKILL.md",[],[],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":19},"01M785WEFHB0G2S9YA6EPR3H0E","xurl","X\u002FTwitter via xurl CLI: post, search, DM, media, v2 API.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fxurl\u002FSKILL.md",[],[],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":19},"01M785W98EDN4EFJXJPMQEHCRC","touchdesigner-mcp","Control a running TouchDesigner instance via twozero MCP — create operators, set parameters, wire connections, execute Python, build real-time visuals. 36 native tools.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Ftouchdesigner-mcp\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M785W5S9FP3QBH2V191E025P","test-driven-development","TDD: enforce RED-GREEN-REFACTOR, tests before code.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Ftest-driven-development\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M785W2AS08NSSH9YATCV6FJB","teams-meeting-pipeline","Operate the Teams meeting summary pipeline via Hermes CLI — summarize meetings, inspect pipeline status, replay jobs, manage Microsoft Graph subscriptions.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fteams-meeting-pipeline\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M785VXKW4T34BTP1SCHW1R7F","systematic-debugging","4-phase root cause debugging: understand bugs before fixing.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fsystematic-debugging\u002FSKILL.md",[],[]]