[Webkit-unassigned] [Bug 202301] New: [GTK] Can return empty GError message from webkit_web_view_run_javascript_finish()
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Sep 26 22:29:15 PDT 2019
https://bugs.webkit.org/show_bug.cgi?id=202301
Bug ID: 202301
Summary: [GTK] Can return empty GError message from
webkit_web_view_run_javascript_finish()
Product: WebKit
Version: Other
Hardware: Unspecified
OS: Unspecified
Status: NEW
Severity: Normal
Priority: P2
Component: WebKitGTK
Assignee: webkit-unassigned at lists.webkit.org
Reporter: mcrha at redhat.com
CC: bugs-noreply at webkitgtk.org
My EWebView, a descendant of WebKitWebView, listens for GtkWidget::style-updated and GtkWidget::state-flags-changed signals, and in the callback it calls webkit_web_view_run_javascript(). So far so good, though it sometimes happens that when the window in which the WebView is packed is in its dispose() it also invokes "focus-changed", which can in turn change the style/state of the WebView, thus it calls the signal handler and the webkit_web_view_run_javascript() in it. Only after this also WebView's dispose() is called (where I disconnect these handlers). The result at the end of the javascript call is a GError, whose GError::domain is WEBKIT_JAVASCRIPT_ERROR, GError::code is WEBKIT_JAVASCRIPT_ERROR_SCRIPT_FAILED and the GError::message is an empty string.
I currently ignore such errors, though I believe a heuristic of "empty message->ignore the erorr" is not ideal, it would be better to distinguish from real errors, like instead of an empty message return G_IO_ERORR/G_IO_ERROR_CANCELLED or such (these are returned when the passed-in cancellable is cancelled early enough).
This is with 2.26.0.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20190927/c62a6023/attachment.html>
More information about the webkit-unassigned
mailing list