Skip to content

[ASIM-6921] Keep the details of errors raised by evaluated JS code - #301

Merged
nicoddemus merged 1 commit into
masterfrom
fb-ASIM-6921-js-error-details
Oct 9, 2026
Merged

nicoddemus merged 1 commit into
masterfrom
fb-ASIM-6921-js-error-details

Conversation

@nicoddemus

@nicoddemus nicoddemus commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Errors raised by the code Python evaluates in the graph page reached the error bridge as a bare "Script error.", with no message, location or stack. Chromium hides the details of uncaught errors from scripts injected by runJavaScript.

Fix: the page defines qmxgraphEval, which evaluates the script with an indirect eval, keeping global scope and the last statement's value as runJavaScript did. eval_js/eval_js_async now send scripts through it, so Chromium treats them as the page's own code and window.onerror gets the full details.

🤖 Generated with Claude Code

@nicoddemus
nicoddemus added this pull request to stack #302 October 8, 2026 19:56
@nicoddemus
nicoddemus marked this pull request as ready for review October 8, 2026 19:59
@nicoddemus
nicoddemus requested a review from BeneBr October 8, 2026 19:59
@coveralls

coveralls commented Oct 8, 2026 •

Copy link
Copy Markdown

Coverage Status

No base build to compare — fb-ASIM-6921-js-error-details into master

Comment thread src/qmxgraph/_web_view.py
Comment thread tests/test_qt_js_integration.py Outdated
@nicoddemus
nicoddemus force-pushed the fb-ASIM-6921-js-error-details branch 2 times, most recently from e0e0619 to aa693b4 Compare October 9, 2026 16:22
@nicoddemus
nicoddemus force-pushed the fb-ASIM-6921-js-error-details branch from aa693b4 to a438012 Compare October 9, 2026 16:27
Base automatically changed from fb-ASIM-6255-qmxgraph-build to master October 9, 2026 16:35
Errors raised by the code Python evaluates in the graph page, like calling
a JS function that doesn't exist or a syntax error, reached the error
bridge as a bare "Script error." with no message, location or stack:
Chromium hides the details of uncaught errors from scripts injected by
`runJavaScript`. Errors raised inside the page's own code were not
affected, and all QtWebEngine 5.15 builds in use behave the same.

Have a function defined by the page evaluate the scripts instead, so
Chromium treats them as the page's own code and the error handler gets the
full details, and drop the xfail from the test that caught it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nicoddemus
nicoddemus force-pushed the fb-ASIM-6921-js-error-details branch from a438012 to 516bf17 Compare October 9, 2026 16:35
@nicoddemus
nicoddemus merged commit 91d75fd into master Oct 9, 2026
5 checks passed
@nicoddemus
nicoddemus deleted the fb-ASIM-6921-js-error-details branch October 9, 2026 16:44
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.

3 participants