Skip to content

Hackbrowser crawl depth: terminates after 3-5 pages on weak models / SPA targets #87

Description

@badchars

Problem

Hackbrowser crawls often terminate after only 3-5 pages, especially with:

  • Weaker AI models (GPT-4o-mini, Haiku) that fail to generate valid page plans
  • SPA targets where navigation is done via onClick handlers, not <a href> tags
  • Multi-credential mode where redirect detection produces false positives

Root Causes (from audit)

  1. planPage returns empty plan on model failurenavigator.ts:131. When LLM output can't be parsed, { tasks: [] } is returned. No actions executed, no new endpoints discovered.

  2. collectDOMLinks only collects <a href>agent.ts:1592. Misses <form action>, <button>, [data-href], [onclick], SPA router elements. On modern SPAs this finds 0-3 links.

  3. ACCESS_DENIED_PATTERNS false positivesagent.ts:1949. Regex /\/(login|signin|...|auth)/i matches legitimate pages like /auth/profile, /auth/settings.

  4. MAX_PER_PATH_PATTERN = 5 too aggressiveagent.ts:566. Same pathname + param keys pattern limited to 5 URLs.

  5. resolveElement failures silently droppedagent.ts:1226. Wrong role/label from weak model → all tasks silently skipped.

  6. No network-based URL discoverypage.on("request") captures traffic but doesn't feed discovered URLs back into the page queue. JS files, XHR calls, and API endpoints are invisible to the crawler.

Expected Behavior

  • Crawl should explore significantly more pages before terminating
  • Network traffic (JS, XHR, fetch) should feed back into discovery
  • Weak model failures should fall back to mechanical DOM interaction
  • Browser should stay useful after scan completion (capture manual browsing)

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions