From meain-dotfiles
Firefox browser automation on macOS: open URLs, manage tabs, capture tab info, and send keystrokes via AppleScript and UI scripting.
How this agent operates — its isolation, permissions, and tool access model
Agent reference
meain-dotfiles:agents/.agents/skills/firefox/skillThe summary Claude sees when deciding whether to delegate to this agent
Automate Firefox via AppleScript + System Events UI scripting. > All `osascript` calls require `dangerouslyDisableSandbox: true`. **Works natively:** - Open a URL (new tab) - Get active tab title per window - Close a window - Window properties (bounds, visibility, minimize) - Activate/focus Firefox **Works via UI scripting (System Events):** - Close current tab (`Cmd+W`) - Switch to a tab by na...
Automate Firefox via AppleScript + System Events UI scripting.
All
osascriptcalls requiredangerouslyDisableSandbox: true.
Works natively:
Works via UI scripting (System Events):
Cmd+W)%<query> in address bar)Does NOT work:
tabs as AppleScript objects)tell application "Firefox"
activate
open location "https://example.com"
end tell
tell application "Firefox"
set names to {}
repeat with i from 1 to (count windows)
try
set end of names to (i as string) & ": " & name of window i
end try
end repeat
return names
end tell
tell application "Firefox"
close window 2
end tell
tell application "Firefox"
activate
end tell
delay 0.3
tell application "System Events"
tell process "Firefox"
keystroke "l" using command down
delay 0.3
keystroke "a" using command down
delay 0.1
keystroke "c" using command down
delay 0.2
end tell
end tell
do shell script "pbpaste"
-- Uses Firefox's built-in tab search: type "% <query>" in address bar
-- Must open a new tab first so the address bar is focused and ready
tell application "Firefox"
activate
end tell
delay 0.5
tell application "System Events"
tell process "Firefox"
keystroke "t" using command down -- open new tab (address bar auto-focused)
delay 1
keystroke "% YOUR_QUERY_HERE"
delay 1.5
key code 125 -- arrow down to first result
delay 0.5
key code 36 -- Enter to switch
end tell
end tell
-- Open a new tab, search for the tab, switch to it, then close it
tell application "Firefox"
activate
end tell
delay 0.5
tell application "System Events"
tell process "Firefox"
keystroke "t" using command down
delay 1
keystroke "% YOUR_QUERY_HERE"
delay 1.5
key code 125 -- arrow down to first result
delay 0.5
key code 36 -- Enter to switch to the found tab
delay 0.8
keystroke "w" using command down -- close it
end tell
end tell
tell application "Firefox"
activate
end tell
delay 0.2
tell application "System Events"
tell process "Firefox"
keystroke "w" using command down
end tell
end tell
tell application "Firefox"
activate
end tell
delay 0.2
tell application "System Events"
tell process "Firefox"
keystroke "r" using command down -- e.g. Cmd+R to reload
end tell
end tell
Before closing any tab or window, confirm with the user which one to close. Prefer identifying by title. Never assume which window index is which without first listing window names.
To identify windows before acting:
tell application "Firefox"
set names to {}
repeat with i from 1 to (count windows)
try
set end of names to (i as string) & ": " & name of window i
end try
end repeat
return names
end tell
npx claudepluginhub meain/dotfilesBrowser automation and terminal spawning specialist with 82 tabz MCP tools for screenshots, clicks, form filling, tab/group management, DOM inspection, network/downloads, bookmarks/history, and TTS. Delegate for browser tasks or terminal spawning.
Desktop automation specialist for macOS. Controls native apps like Finder, System Settings, Preview, and Notes via Computer Use. Handles file operations, app navigation, and cross-app workflows. Delegate repetitive desktop tasks to this agent.
Browser automation agent that controls real Chrome via chromux (raw CDP). Parallel-safe with isolated tabs and persistent logins. Use for exploring web services, dashboards, or sites that require login.