apple_safari
Open URLs, manage tabs, navigate history, run JavaScript, and access bookmarks, reading list, and recent history in Safari.
Instructions
Control Safari browser. Actions: open_url, current_url, current_title, list_tabs, close_tab, new_tab, reload, page_text, reading_list, js_execute, back, forward, bookmarks, history_recent, private_window, close_window, tab_count.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | URL to open | |
| code | No | JavaScript code to execute | |
| action | Yes | open_url: Open a URL in Safari; current_url: Get URL of the current Safari tab; current_title: Get title of the current Safari tab; list_tabs: List all open Safari tabs across all windows; close_tab: Close the current Safari tab; new_tab: Open a new Safari tab, optionally with a URL; reload: Reload the current Safari page; page_text: Get visible text of current Safari page (first 2000 chars). Requires 'Allow JavaScript from Apple Events' in Safari > Develop.; reading_list: Add a URL to Safari Reading List; js_execute: Execute JavaScript in the current Safari tab. Requires 'Allow JavaScript from Apple Events' in Safari > Develop.; back: Go back in browser history; forward: Go forward in browser history; bookmarks: List top-level Safari bookmarks (reads from Bookmarks.plist); history_recent: Get recent Safari history entries (up to 15); private_window: Open a new private browsing window in Safari; close_window: Close the front Safari window; tab_count: Count total open tabs across all Safari windows | |
| confirm | No | Set to true to confirm a protected/destructive action. Without this, protected actions return a preview instead of executing. |