Browser Opener Skill
This skill provides cross-platform browser opening capabilities with support for multiple browsers.
Quick Start
Open a URL with the default browser:
CODEBLOCK0
Open a URL with a specific browser:
CODEBLOCK1
Supported Browsers
- - Chrome:
chrome, google-chrome, INLINECODE2 - Firefox:
firefox, INLINECODE4 - Edge:
edge, INLINECODE6 - Safari:
safari, INLINECODE8 - Default:
default (uses system default browser)
Usage Examples
See examples/ for comprehensive usage examples including:
- - Basic URL opening
- Browser-specific launching
- Batch opening multiple URLs
- Error handling scenarios
Browser Support Details
For detailed information about browser support on different platforms, see references/browser_support.md.
Command Line Options
The scripts/open_browser.py script supports the following options:
- -
--url: URL to open (required) - INLINECODE12 : Browser to use (optional, defaults to 'default')
- INLINECODE13 : Open in new window (optional)
- INLINECODE14 : Open in incognito/private mode (optional)
- INLINECODE15 : Open in headless mode (optional, for testing)
Error Handling
The script includes comprehensive error handling for:
- - Invalid URLs
- Browser not found
- Permission issues
- Platform-specific errors
浏览器打开技能
本技能提供跨平台的浏览器打开功能,支持多种浏览器。
快速开始
使用默认浏览器打开URL:
python
使用浏览器打开脚本
python scripts/open_browser.py --url https://www.google.com
使用指定浏览器打开URL:
python
使用Chrome打开
python scripts/open_browser.py --url https://www.google.com --browser chrome
使用Firefox打开
python scripts/open_browser.py --url https://www.google.com --browser firefox
使用Edge打开
python scripts/open_browser.py --url https://www.google.com --browser edge
支持的浏览器
- - Chrome:chrome、google-chrome、google-chrome-stable
- Firefox:firefox、mozilla-firefox
- Edge:edge、microsoft-edge
- Safari:safari、apple-safari
- 默认:default(使用系统默认浏览器)
使用示例
参见 examples/ 获取完整的使用示例,包括:
- - 基本URL打开
- 指定浏览器启动
- 批量打开多个URL
- 错误处理场景
浏览器支持详情
关于不同平台上的浏览器支持详细信息,请参见 references/browser_support.md。
命令行选项
scripts/open_browser.py 脚本支持以下选项:
- - --url:要打开的URL(必填)
- --browser:要使用的浏览器(可选,默认为default)
- --new-window:在新窗口中打开(可选)
- --incognito:在无痕/隐私模式下打开(可选)
- --headless:在无头模式下打开(可选,用于测试)
错误处理
该脚本包含全面的错误处理,针对以下情况: