Skip to content

fix: blank tab auto-recovery for web_scan/web_execute_js#580

Open
chen70456-lang wants to merge 1 commit into
lsdefine:mainfrom
chen70456-lang:main
Open

fix: blank tab auto-recovery for web_scan/web_execute_js#580
chen70456-lang wants to merge 1 commit into
lsdefine:mainfrom
chen70456-lang:main

Conversation

@chen70456-lang

Copy link
Copy Markdown

Problem

Chrome opens with about:blank by default. The extension's isScriptable filter rejects about: protocol → TMWebDriver gets 0 sessions → web_scan/web_execute_js return "no tabs available" error

Changes

TMWebDriver.py

  • Add ensure_tab() which auto-opens Chrome with a URL when no active sessions
  • Race-condition-safe: timeout + post-loop check ensures tab is fully initialized

ga.py

  • web_scan/web_execute_js/first_init_driver now call ensure_tab() instead of immediately returning error on empty sessions

Extension (background.js)

  • isServerAlive() probes HTTP API port (18766) first, with WS port (18765) fallback for faster detection

Testing

✅ web_scan on fresh blank tab → auto-recovers
✅ web_execute_js on recovered tab
✅ Weather search end-to-end

Problem: Chrome opens with about:blank by default, extension's
isScriptable filter rejects about: protocol → TMWebDriver gets
0 sessions → web_scan/web_execute_js returns error.

Fix:
- TMWebDriver: add ensure_tab() which auto-opens Chrome with URL
  when no active sessions, with race-condition-safe timeout + post-loop check
- ga.py: web_scan/web_execute_js/first_init_driver now call ensure_tab()
  instead of immediately returning error on empty sessions
- background.js: isServerAlive() probes HTTP API port (18766) first,
  with WS port (18765) fallback for faster detection
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.

2 participants