← スキル一覧に戻る

browser-abstraction-layer
by treylom
Knowledge Manager Agent for Claude Code - Extract and organize content from web, PDF, social media to Obsidian/Notion
⭐ 10🍴 5📅 2026年1月22日
SKILL.md
name: Browser Abstraction Layer description: Unified browser interface for Antigravity native, Playwright, and Hyperbrowser providers
Browser Abstraction Layer
Unified interface for web content extraction across browser providers
Provider Selection
function get_browser_provider() {
// 1. Check environment first
if (is_antigravity_environment()) {
return "antigravity" // Use native browser agent
}
// 2. Fall back to config
config = Read("km-config.json")
return config?.browser?.provider || "playwright"
}
function is_antigravity_environment() {
// Antigravity provides built-in browser capabilities
// Check if running inside Antigravity IDE
return typeof antigravity !== 'undefined' ||
process.env.ANTIGRAVITY_SESSION ||
file_exists("~/.gemini/antigravity/")
}
Provider Comparison
| Feature | Antigravity Native | Playwright | Hyperbrowser |
|---|---|---|---|
| Setup required | None (built-in) | MCP server | MCP + API key |
| Simple scraping | Natural language | navigate → snapshot | scrape_webpage |
| Stealth mode | Built-in | Not supported | useStealth: true |
| Social media | Excellent | May be blocked | Good |
| Cost | Free (with Antigravity) | Free | API key required |
| Authentication | Session-aware | Limited | Profile support |
Unified Scraping Function
function scrape_url(url, options = {}) {
provider = get_browser_provider()
switch (provider) {
case "antigravity":
// Antigravity has built-in browser agent
// Simply ask it to fetch and analyze the page
return antigravity_browser_fetch(url, options)
case "hyperbrowser":
return mcp__hyperbrowser__scrape_webpage({
url: url,
outputFormat: ["markdown"],
sessionOptions: {
useStealth: options.stealth || false
}
})
case "playwright":
default:
mcp__playwright__browser_navigate({ url: url })
mcp__playwright__browser_wait_for({ time: 3 })
return mcp__playwright__browser_snapshot()
}
}
Antigravity Native Browser
Antigravity has a powerful built-in browser agent. No MCP configuration needed.
Usage in Antigravity
Instead of calling MCP tools, simply instruct the agent:
Browse to https://example.com/article and extract the main content.
Or for more structured extraction:
Go to this URL and summarize the key points:
https://example.com/article
Advantages
- No setup: Works out of the box
- Session-aware: Can handle login states
- Smart extraction: AI-powered content understanding
- Anti-bot bypass: Better success with protected sites
When to Use Playwright Instead
Even in Antigravity, you might want Playwright MCP for:
- Automated screenshot capture
- Specific DOM manipulation
- Programmatic form filling
- Headless batch processing
Social Media Detection
function requires_stealth(url) {
const patterns = [
/threads\.net\//,
/instagram\.com\/p\//,
/instagram\.com\/reel\//,
/twitter\.com\//,
/x\.com\//
]
return patterns.some(p => p.test(url))
}
Provider Recommendations by URL Type
| URL Pattern | Best Provider | Fallback |
|---|---|---|
| threads.net | Antigravity / Hyperbrowser | - |
| instagram.com | Antigravity / Hyperbrowser | - |
| twitter.com/x.com | Antigravity | Hyperbrowser |
| Regular websites | Any | Playwright |
| Login-required sites | Antigravity | Hyperbrowser (with profile) |
Fallback Strategy
function scrape_with_fallback(url, options = {}) {
provider = get_browser_provider()
try {
return scrape_url(url, options)
} catch (error) {
// If primary provider fails, try alternatives
if (provider === "playwright" && requires_stealth(url)) {
console.warn("Playwright blocked. Try Antigravity native or Hyperbrowser.")
}
if (provider === "antigravity") {
// Antigravity native rarely fails, but if it does:
console.warn("Browser fetch failed. Retrying with different approach.")
}
throw error
}
}
スコア
総合スコア
60/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
✓説明文
100文字以上の説明がある
+10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です