بنقرة واحدة
browser-abstraction-layer
// Unified browser interface for Antigravity native, Playwright, and Hyperbrowser providers
// Unified browser interface for Antigravity native, Playwright, and Hyperbrowser providers
Generate professional slide deck images from content. Creates comprehensive outlines with style instructions, then generates individual slide images. Use when user asks to "create slides", "make a presentation", "generate deck", or "slide deck".
6-phase workflow for content extraction, analysis, and export to Obsidian/Notion
Extract content from Threads, Instagram with reply collection and depth control
Unified storage interface for Obsidian, Notion, and local file systems
Automated setup wizard for Knowledge Manager - configures MCP servers and creates config files
Output format specifications for Obsidian, Notion, and Markdown exports
| name | Browser Abstraction Layer |
| description | Unified browser interface for Antigravity native, Playwright, and Hyperbrowser providers |
Unified interface for web content extraction across browser providers
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/")
}
| 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 |
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 has a powerful built-in browser agent. No MCP configuration needed.
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
Even in Antigravity, you might want Playwright MCP for:
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))
}
| 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) |
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
}
}