[geary/wip/728002-webkit2] Add some WebView and WebProcess debugging.
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/wip/728002-webkit2] Add some WebView and WebProcess debugging.
- Date: Thu, 1 Dec 2016 23:38:14 +0000 (UTC)
commit d67e288912f78bcbaf619079f28877adc1975030
Author: Michael James Gratton <mike vee net>
Date: Thu Dec 1 12:08:08 2016 +1100
Add some WebView and WebProcess debugging.
src/client/components/client-web-view.vala | 6 ++++-
src/client/web-process/web-process-extension.vala | 25 ++++++++++-----------
2 files changed, 17 insertions(+), 14 deletions(-)
---
diff --git a/src/client/components/client-web-view.vala b/src/client/components/client-web-view.vala
index ff05cc7..153aef3 100644
--- a/src/client/components/client-web-view.vala
+++ b/src/client/components/client-web-view.vala
@@ -203,7 +203,7 @@ public class ClientWebView : WebKit.WebView {
WebKit.UserContentManager content_manager =
custom_manager ?? new WebKit.UserContentManager();
content_manager.add_script(ClientWebView.script);
-
+
Object(user_content_manager: content_manager, settings: setts);
// XXX get the allow prefix from the extension somehow
@@ -214,6 +214,10 @@ public class ClientWebView : WebKit.WebView {
this.is_loaded = true;
}
});
+ this.web_process_crashed.connect(() => {
+ debug("Web process crashed");
+ return Gdk.EVENT_PROPAGATE;
+ });
content_manager.script_message_received[PREFERRED_HEIGHT_MESSAGE].connect(
(result) => {
diff --git a/src/client/web-process/web-process-extension.vala
b/src/client/web-process/web-process-extension.vala
index 5b2a61e..3dbbad1 100644
--- a/src/client/web-process/web-process-extension.vala
+++ b/src/client/web-process/web-process-extension.vala
@@ -38,8 +38,7 @@ public class GearyWebExtension : Object {
public GearyWebExtension(WebKit.WebExtension extension) {
this.extension = extension;
extension.page_created.connect((extension, web_page) => {
- // XXX Re-enable when we can depend on WK2 2.12
- // web_page.console_message_sent.connect(on_console_message);
+ web_page.console_message_sent.connect(on_console_message);
web_page.send_request.connect(on_send_request);
web_page.get_editor().selection_changed.connect(() => {
selection_changed(web_page);
@@ -47,17 +46,17 @@ public class GearyWebExtension : Object {
});
}
- // XXX Re-enable when we can depend on WK2 2.12
- // private void on_console_message(WebKit.WebPage page,
- // WebKit.ConsoleMessage message) {
- // debug("[%s] %s %s:%u: %s",
- // message.get_level().to_string(),
- // message.get_source().to_string(),
- // message.get_source_id(),
- // message.get_line(),
- // message.get_text()
- // );
- // }
+ // XXX Conditionally enable while we still depend on WK2 <2.12
+ private void on_console_message(WebKit.WebPage page,
+ WebKit.ConsoleMessage message) {
+ debug("Console: [%s] %s %s:%u: %s",
+ message.get_level().to_string(),
+ message.get_source().to_string(),
+ message.get_source_id(),
+ message.get_line(),
+ message.get_text()
+ );
+ }
private bool on_send_request(WebKit.WebPage page,
WebKit.URIRequest request,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]