Back to list
treylom

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📅 Jan 22, 2026

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

FeatureAntigravity NativePlaywrightHyperbrowser
Setup requiredNone (built-in)MCP serverMCP + API key
Simple scrapingNatural languagenavigatesnapshotscrape_webpage
Stealth modeBuilt-inNot supporteduseStealth: true
Social mediaExcellentMay be blockedGood
CostFree (with Antigravity)FreeAPI key required
AuthenticationSession-awareLimitedProfile 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

  1. No setup: Works out of the box
  2. Session-aware: Can handle login states
  3. Smart extraction: AI-powered content understanding
  4. 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 PatternBest ProviderFallback
threads.netAntigravity / Hyperbrowser-
instagram.comAntigravity / Hyperbrowser-
twitter.com/x.comAntigravityHyperbrowser
Regular websitesAnyPlaywright
Login-required sitesAntigravityHyperbrowser (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
  }
}

Score

Total Score

60/100

Based on repository quality metrics

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

Reviews

💬

Reviews coming soon