Skip to content

fix(extension): stop iframe hangs and add debug mode - #229

Draft
arunSunnyKVS wants to merge 1 commit into
masterfrom
fix/extension-hang-timeouts-and-debug
Draft

fix(extension): stop iframe hangs and add debug mode#229
arunSunnyKVS wants to merge 1 commit into
masterfrom
fix/extension-hang-timeouts-and-debug

Conversation

@arunSunnyKVS

Copy link
Copy Markdown
Collaborator

Problem

On pages with unresponsive cross-origin iframes (e.g. Google Maps embeds), chrome.scripting.executeScript({ allFrames: true }) could block forever. The extension hung at "Detecting chat widget…" / agent-context detection with no timeout or visibility into what failed.

Separately, Chat360/Draft.js widgets nest message text deeper than the snapshot walker’s depth-15 limit, so bot replies were never extracted even when sends succeeded.

Solution

  • Wrap allFrames scripting paths in Promise.race timeouts with main-frame-only fallbacks (collectFrames, AX snapshots, shadow patch, response scan, agent-context summarize).
  • Raise frame_snapshot.js collect depth from 15 → 25 so deeply nested message bodies are captured.
  • Add an extension debug mode (debugLog.js + popup toggle / export / clear) that logs locate, LLM UI actions, send, and extract steps to the service worker + storage.
  • Improve frame_actuate.js failure details when submit is not accepted.

Changes

  • runners/extension/debugLog.js (new)
  • runners/extension/{agentContext,chatLocator,domActions,domTarget,frameDiscovery,frame_actuate,frame_snapshot,llm,llmUiActions,orchestrator,popup,responseExtractor,service_worker}.*

Issue

N/A

How to test

  1. Load unpacked runners/extension in Chrome.
  2. Open Advanced → enable Debug mode.
  3. Run against a page that previously hung (e.g. hospital site with Maps iframe) — locate should progress past allFrames within ~15–45s via fallback instead of hanging forever.
  4. Run against a Chat360 widget (e.g. hyundai.com/in) — after send, response extraction should capture bot text (depth fix).
  5. Export logs from Advanced and confirm locate / LLM / send / extract events appear.

Screenshots

N/A — debug toggle lives under Advanced settings in the side panel.

Made with Cursor

chrome.scripting.executeScript({ allFrames: true }) could block forever on
unresponsive cross-origin frames; add timeouts with main-frame fallbacks,
raise snapshot depth for Draft.js widgets, and ship a debug-log UI for runs.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b8321a1e-b589-4d2d-ab63-3863251208e7

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant