<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[193620] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/193620">193620</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2015-12-07 03:56:25 -0800 (Mon, 07 Dec 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>[GTK] Add WebKitWebPage::console-message-sent signal to Web Extensions API
https://bugs.webkit.org/show_bug.cgi?id=79918

Reviewed by Gustavo Noronha Silva.

Source/WebKit2:

Add WebKitConsoleMessage boxed type that is passed to the
WebKitWebPage::console-message-sent signal with all the details
about the message.

* PlatformGTK.cmake: Add new files to compilation.
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Add new symbols.
* UIProcess/API/gtk/docs/webkit2gtk-4.0.types: Add webkit_console_message_get_type.
* UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add new section to the docs.
* WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h:
(API::InjectedBundle::PageUIClient::willAddMessageToConsole): Add
paramaters for all console message details.
* WebProcess/InjectedBundle/API/gtk/WebKitConsoleMessage.cpp: Added.
(webkit_console_message_copy):
(webkit_console_message_free):
(webkit_console_message_get_source):
(webkit_console_message_get_level):
(webkit_console_message_get_text):
(webkit_console_message_get_line):
(webkit_console_message_get_source_id):
* WebProcess/InjectedBundle/API/gtk/WebKitConsoleMessage.h: Added.
* WebProcess/InjectedBundle/API/gtk/WebKitConsoleMessagePrivate.h: Added.
(_WebKitConsoleMessage::_WebKitConsoleMessage):
* WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
(webkitWebPageDidSendConsoleMessage): Emit the
WebKitWebPage::console-message-sent signal.
(didReceiveResponseForResource): Generate a console message in
case of HTTP failure &gt;= 400 for consistency with the inspector.
(didFailLoadForResource): Generate a console message in case of
resource load failure for consistency with the inspector.
(webkit_web_page_class_init): Add WebKitWebPage::console-message-sent signal.
(webkitWebPageCreate): Set custom UI client.
* WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h:
* WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
(WebKit::InjectedBundlePageUIClient::willAddMessageToConsole):
* WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::addMessageToConsole): Pass all the
console message details to the ui client.

Tools:

Add unit tests to check the different console messages.

* TestWebKitAPI/Tests/WebKit2Gtk/CMakeLists.txt:
* TestWebKitAPI/Tests/WebKit2Gtk/TestConsoleMessage.cpp: Added.
(ConsoleMessageTest::ConsoleMessage::operator==):
(ConsoleMessageTest::consoleMessageReceivedCallback):
(ConsoleMessageTest::ConsoleMessageTest):
(ConsoleMessageTest::~ConsoleMessageTest):
(ConsoleMessageTest::waitUntilConsoleMessageReceived):
(testWebKitConsoleMessageConsoleAPI):
(testWebKitConsoleMessageJavaScriptException):
(testWebKitConsoleMessageNetworkError):
(testWebKitConsoleMessageSecurityError):
(beforeAll):
(afterAll):
* TestWebKitAPI/Tests/WebKit2Gtk/WebExtensionTest.cpp:
(consoleMessageSentCallback):
(pageCreatedCallback):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2PlatformGTKcmake">trunk/Source/WebKit2/PlatformGTK.cmake</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkdocswebkit2gtk40sectionstxt">trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkdocswebkit2gtk40types">trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-4.0.types</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkdocswebkit2gtkdocssgml">trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleAPIAPIInjectedBundlePageUIClienth">trunk/Source/WebKit2/WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleAPIgtkWebKitWebPagecpp">trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleAPIgtkwebkitwebextensionh">trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleInjectedBundlePageUIClientcpp">trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleInjectedBundlePageUIClienth">trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportWebChromeClientcpp">trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2GtkCMakeListstxt">trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/CMakeLists.txt</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2GtkWebExtensionTestcpp">trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/WebExtensionTest.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleAPIgtkWebKitConsoleMessagecpp">trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitConsoleMessage.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleAPIgtkWebKitConsoleMessageh">trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitConsoleMessage.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleAPIgtkWebKitConsoleMessagePrivateh">trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitConsoleMessagePrivate.h</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2GtkTestConsoleMessagecpp">trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestConsoleMessage.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (193619 => 193620)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-12-07 11:46:28 UTC (rev 193619)
+++ trunk/Source/WebKit2/ChangeLog        2015-12-07 11:56:25 UTC (rev 193620)
</span><span class="lines">@@ -1,3 +1,49 @@
</span><ins>+2015-12-07  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
+
+        [GTK] Add WebKitWebPage::console-message-sent signal to Web Extensions API
+        https://bugs.webkit.org/show_bug.cgi?id=79918
+
+        Reviewed by Gustavo Noronha Silva.
+
+        Add WebKitConsoleMessage boxed type that is passed to the
+        WebKitWebPage::console-message-sent signal with all the details
+        about the message.
+
+        * PlatformGTK.cmake: Add new files to compilation.
+        * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Add new symbols.
+        * UIProcess/API/gtk/docs/webkit2gtk-4.0.types: Add webkit_console_message_get_type.
+        * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add new section to the docs.
+        * WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h:
+        (API::InjectedBundle::PageUIClient::willAddMessageToConsole): Add
+        paramaters for all console message details.
+        * WebProcess/InjectedBundle/API/gtk/WebKitConsoleMessage.cpp: Added.
+        (webkit_console_message_copy):
+        (webkit_console_message_free):
+        (webkit_console_message_get_source):
+        (webkit_console_message_get_level):
+        (webkit_console_message_get_text):
+        (webkit_console_message_get_line):
+        (webkit_console_message_get_source_id):
+        * WebProcess/InjectedBundle/API/gtk/WebKitConsoleMessage.h: Added.
+        * WebProcess/InjectedBundle/API/gtk/WebKitConsoleMessagePrivate.h: Added.
+        (_WebKitConsoleMessage::_WebKitConsoleMessage):
+        * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
+        (webkitWebPageDidSendConsoleMessage): Emit the
+        WebKitWebPage::console-message-sent signal.
+        (didReceiveResponseForResource): Generate a console message in
+        case of HTTP failure &gt;= 400 for consistency with the inspector.
+        (didFailLoadForResource): Generate a console message in case of
+        resource load failure for consistency with the inspector.
+        (webkit_web_page_class_init): Add WebKitWebPage::console-message-sent signal.
+        (webkitWebPageCreate): Set custom UI client.
+        * WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h:
+        * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
+        (WebKit::InjectedBundlePageUIClient::willAddMessageToConsole):
+        * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
+        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+        (WebKit::WebChromeClient::addMessageToConsole): Pass all the
+        console message details to the ui client.
+
</ins><span class="cx"> 2015-12-07  Ryuan Choi  &lt;ryuan.choi@navercorp.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [EFL] MiniBrowser doesn't exit when called ewk_view_try_close()
</span></span></pre></div>
<a id="trunkSourceWebKit2PlatformGTKcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/PlatformGTK.cmake (193619 => 193620)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/PlatformGTK.cmake        2015-12-07 11:46:28 UTC (rev 193619)
+++ trunk/Source/WebKit2/PlatformGTK.cmake        2015-12-07 11:56:25 UTC (rev 193620)
</span><span class="lines">@@ -323,6 +323,7 @@
</span><span class="cx">     WebProcess/Cookies/soup/WebCookieManagerSoup.cpp
</span><span class="cx">     WebProcess/Cookies/soup/WebKitSoupCookieJarSqlite.cpp
</span><span class="cx"> 
</span><ins>+    WebProcess/InjectedBundle/API/gtk/WebKitConsoleMessage.cpp
</ins><span class="cx">     WebProcess/InjectedBundle/API/gtk/WebKitFrame.cpp
</span><span class="cx">     WebProcess/InjectedBundle/API/gtk/WebKitScriptWorld.cpp
</span><span class="cx">     WebProcess/InjectedBundle/API/gtk/WebKitWebEditor.cpp
</span><span class="lines">@@ -433,6 +434,7 @@
</span><span class="cx"> )
</span><span class="cx"> 
</span><span class="cx"> set(WebKit2WebExtension_INSTALLED_HEADERS
</span><ins>+    ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/WebKitConsoleMessage.h
</ins><span class="cx">     ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/WebKitFrame.h
</span><span class="cx">     ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/WebKitScriptWorld.h
</span><span class="cx">     ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/WebKitWebEditor.h
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkdocswebkit2gtk40sectionstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt (193619 => 193620)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt        2015-12-07 11:46:28 UTC (rev 193619)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt        2015-12-07 11:56:25 UTC (rev 193620)
</span><span class="lines">@@ -1344,6 +1344,26 @@
</span><span class="cx"> &lt;/SECTION&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;SECTION&gt;
</span><ins>+&lt;FILE&gt;WebKitConsoleMessage&lt;/FILE&gt;
+WebKitConsoleMessage
+WebKitConsoleMessageSource
+WebKitConsoleMessageLevel
+webkit_console_message_copy
+webkit_console_message_free
+webkit_console_message_get_source
+webkit_console_message_get_level
+webkit_console_message_get_text
+webkit_console_message_get_line
+webkit_console_message_get_source_id
+
+&lt;SUBSECTION Standard&gt;
+WEBKIT_TYPE_CONSOLE_MESSAGE
+
+&lt;SUBSECTION Private&gt;
+webkit_console_message_get_type
+&lt;/SECTION&gt;
+
+&lt;SECTION&gt;
</ins><span class="cx"> &lt;FILE&gt;WebKitColorChooserRequest&lt;/FILE&gt;
</span><span class="cx"> WebKitColorChooserRequest
</span><span class="cx"> webkit_color_chooser_request_get_rgba
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkdocswebkit2gtk40types"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-4.0.types (193619 => 193620)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-4.0.types        2015-12-07 11:46:28 UTC (rev 193619)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-4.0.types        2015-12-07 11:56:25 UTC (rev 193620)
</span><span class="lines">@@ -32,3 +32,4 @@
</span><span class="cx"> webkit_website_data_manager_get_type
</span><span class="cx"> webkit_editor_state_get_type
</span><span class="cx"> webkit_install_missing_media_plugins_permission_request_get_type
</span><ins>+webkit_console_message_get_type
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkdocswebkit2gtkdocssgml"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml (193619 => 193620)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml        2015-12-07 11:46:28 UTC (rev 193619)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml        2015-12-07 11:56:25 UTC (rev 193620)
</span><span class="lines">@@ -62,6 +62,7 @@
</span><span class="cx">     &lt;xi:include href=&quot;xml/WebKitScriptWorld.xml&quot;/&gt;
</span><span class="cx">     &lt;xi:include href=&quot;xml/WebKitWebHitTestResult.xml&quot;/&gt;
</span><span class="cx">     &lt;xi:include href=&quot;xml/WebKitWebEditor.xml&quot;/&gt;
</span><ins>+    &lt;xi:include href=&quot;xml/WebKitConsoleMessage&quot;/&gt;
</ins><span class="cx">   &lt;/chapter&gt;
</span><span class="cx"> 
</span><span class="cx">   &lt;index id=&quot;index-all&quot;&gt;
</span><span class="lines">@@ -98,5 +99,10 @@
</span><span class="cx">     &lt;xi:include href=&quot;xml/api-index-2.10.xml&quot;&gt;&lt;xi:fallback /&gt;&lt;/xi:include&gt;
</span><span class="cx">   &lt;/index&gt;
</span><span class="cx"> 
</span><ins>+  &lt;index id=&quot;api-index-2-12&quot; role=&quot;2.12&quot;&gt;
+    &lt;title&gt;Index of new symbols in 2.12&lt;/title&gt;
+    &lt;xi:include href=&quot;xml/api-index-2.12.xml&quot;&gt;&lt;xi:fallback /&gt;&lt;/xi:include&gt;
+  &lt;/index&gt;
+
</ins><span class="cx">   &lt;xi:include href=&quot;xml/annotation-glossary.xml&quot;&gt;&lt;xi:fallback /&gt;&lt;/xi:include&gt;
</span><span class="cx"> &lt;/book&gt;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleAPIAPIInjectedBundlePageUIClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h (193619 => 193620)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h        2015-12-07 11:46:28 UTC (rev 193619)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h        2015-12-07 11:56:25 UTC (rev 193620)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #define APIInjectedBundlePageUIClient_h
</span><span class="cx"> 
</span><span class="cx"> #include &quot;WebEvent.h&quot;
</span><ins>+#include &lt;runtime/ConsoleTypes.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> class HitTestResult;
</span><span class="lines">@@ -49,7 +50,7 @@
</span><span class="cx"> public:
</span><span class="cx">     virtual ~PageUIClient() { }
</span><span class="cx"> 
</span><del>-    virtual void willAddMessageToConsole(WebKit::WebPage*, const WTF::String&amp; message, int32_t lineNumber) { UNUSED_PARAM(message); UNUSED_PARAM(lineNumber); }
</del><ins>+    virtual void willAddMessageToConsole(WebKit::WebPage*, JSC::MessageSource, JSC::MessageLevel, const WTF::String&amp; message, unsigned lineNumber, unsigned columnNumber, const WTF::String&amp; sourceID) { UNUSED_PARAM(message); UNUSED_PARAM(lineNumber); UNUSED_PARAM(columnNumber); UNUSED_PARAM(sourceID); }
</ins><span class="cx">     virtual void willSetStatusbarText(WebKit::WebPage*, const WTF::String&amp;) { }
</span><span class="cx">     virtual void willRunJavaScriptAlert(WebKit::WebPage*, const WTF::String&amp;, WebKit::WebFrame*) { }
</span><span class="cx">     virtual void willRunJavaScriptConfirm(WebKit::WebPage*, const WTF::String&amp;, WebKit::WebFrame*) { }
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleAPIgtkWebKitConsoleMessagecpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitConsoleMessage.cpp (0 => 193620)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitConsoleMessage.cpp                                (rev 0)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitConsoleMessage.cpp        2015-12-07 11:56:25 UTC (rev 193620)
</span><span class="lines">@@ -0,0 +1,166 @@
</span><ins>+/*
+ * Copyright (C) 2015 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;WebKitConsoleMessage.h&quot;
+
+#include &quot;WebKitConsoleMessagePrivate.h&quot;
+
+G_DEFINE_BOXED_TYPE(WebKitConsoleMessage, webkit_console_message, webkit_console_message_copy, webkit_console_message_free)
+
+/**
+ * webkit_console_message_copy:
+ * @console_message: a #WebKitConsoleMessage
+ *
+ * Make a copy of @console_message.
+ *
+ * Returns: (transfer full): A copy of passed in #WebKitConsoleMessage
+ *
+ * Since: 2.12
+ */
+WebKitConsoleMessage* webkit_console_message_copy(WebKitConsoleMessage* consoleMessage)
+{
+    g_return_val_if_fail(consoleMessage, nullptr);
+    WebKitConsoleMessage* copy = static_cast&lt;WebKitConsoleMessage*&gt;(fastZeroedMalloc(sizeof(WebKitConsoleMessage)));
+    new (copy) WebKitConsoleMessage(consoleMessage);
+    return copy;
+}
+
+/**
+ * webkit_console_message_free:
+ * @console_message: a #WebKitConsoleMessage
+ *
+ * Free the #WebKitConsoleMessage
+ *
+ * Since: 2.12
+ */
+void webkit_console_message_free(WebKitConsoleMessage* consoleMessage)
+{
+    g_return_if_fail(consoleMessage);
+    consoleMessage-&gt;~WebKitConsoleMessage();
+    fastFree(consoleMessage);
+}
+
+/**
+ * webkit_console_message_get_source:
+ * @console_message: a #WebKitConsoleMessage
+ *
+ * Gets the source of a #WebKitConsoleMessage
+ *
+ * Returns: a #WebKitConsoleMessageSource indicating the source of @console_message
+ *
+ * Since: 2.12
+ */
+WebKitConsoleMessageSource webkit_console_message_get_source(WebKitConsoleMessage* consoleMessage)
+{
+    g_return_val_if_fail(consoleMessage, WEBKIT_CONSOLE_MESSAGE_SOURCE_OTHER);
+    switch (consoleMessage-&gt;source) {
+    case JSC::MessageSource::JS:
+        return WEBKIT_CONSOLE_MESSAGE_SOURCE_JAVASCRIPT;
+    case JSC::MessageSource::Network:
+        return WEBKIT_CONSOLE_MESSAGE_SOURCE_NETWORK;
+    case JSC::MessageSource::ConsoleAPI:
+        return WEBKIT_CONSOLE_MESSAGE_SOURCE_CONSOLE_API;
+    case JSC::MessageSource::Security:
+        return WEBKIT_CONSOLE_MESSAGE_SOURCE_SECURITY;
+    case JSC::MessageSource::Other:
+    default:
+        break;
+    }
+
+    return WEBKIT_CONSOLE_MESSAGE_SOURCE_OTHER;
+}
+
+/**
+ * webkit_console_message_get_level:
+ * @console_message: a #WebKitConsoleMessage
+ *
+ * Gets the log level of a #WebKitConsoleMessage
+ *
+ * Returns: a #WebKitConsoleMessageLevel indicating the log level of @console_message
+ *
+ * Since: 2.12
+ */
+WebKitConsoleMessageLevel webkit_console_message_get_level(WebKitConsoleMessage* consoleMessage)
+{
+    g_return_val_if_fail(consoleMessage, WEBKIT_CONSOLE_MESSAGE_LEVEL_LOG);
+    switch (consoleMessage-&gt;level) {
+    case JSC::MessageLevel::Log:
+        return WEBKIT_CONSOLE_MESSAGE_LEVEL_LOG;
+    case JSC::MessageLevel::Warning:
+        return WEBKIT_CONSOLE_MESSAGE_LEVEL_WARNING;
+    case JSC::MessageLevel::Error:
+        return WEBKIT_CONSOLE_MESSAGE_LEVEL_ERROR;
+    case JSC::MessageLevel::Debug:
+        return WEBKIT_CONSOLE_MESSAGE_LEVEL_DEBUG;
+    case JSC::MessageLevel::Info:
+        return WEBKIT_CONSOLE_MESSAGE_LEVEL_INFO;
+    }
+
+    ASSERT_NOT_REACHED();
+    return WEBKIT_CONSOLE_MESSAGE_LEVEL_LOG;
+}
+
+/**
+ * webkit_console_message_get_text:
+ * @console_message: a #WebKitConsoleMessage
+ *
+ * Gets the text message of a #WebKitConsoleMessage
+ *
+ * Returns: the text message of @console_message
+ *
+ * Since: 2.12
+ */
+const gchar* webkit_console_message_get_text(WebKitConsoleMessage* consoleMessage)
+{
+    g_return_val_if_fail(consoleMessage, nullptr);
+    return consoleMessage-&gt;message.data();
+}
+
+/**
+ * webkit_console_message_get_line:
+ * @console_message: a #WebKitConsoleMessage
+ *
+ * Gets the line number of a #WebKitConsoleMessage
+ *
+ * Returns: the line number of @console_message
+ *
+ * Since: 2.12
+ */
+guint webkit_console_message_get_line(WebKitConsoleMessage* consoleMessage)
+{
+    g_return_val_if_fail(consoleMessage, 0);
+    return consoleMessage-&gt;lineNumber;
+}
+
+/**
+ * webkit_console_message_get_source_id:
+ * @console_message: a #WebKitConsoleMessage
+ *
+ * Gets the source identifier of a #WebKitConsoleMessage
+ *
+ * Returns: the source identifier of @console_message
+ *
+ * Since: 2.12
+ */
+const gchar* webkit_console_message_get_source_id(WebKitConsoleMessage* consoleMessage)
+{
+    g_return_val_if_fail(consoleMessage, nullptr);
+    return consoleMessage-&gt;sourceID.data();
+}
</ins></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleAPIgtkWebKitConsoleMessageh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitConsoleMessage.h (0 => 193620)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitConsoleMessage.h                                (rev 0)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitConsoleMessage.h        2015-12-07 11:56:25 UTC (rev 193620)
</span><span class="lines">@@ -0,0 +1,102 @@
</span><ins>+/*
+ * Copyright (C) 2015 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#if !defined(__WEBKIT_WEB_EXTENSION_H_INSIDE__) &amp;&amp; !defined(WEBKIT2_COMPILATION)
+#error &quot;Only &lt;webkit2/webkit-web-extension.h&gt; can be included directly.&quot;
+#endif
+
+#ifndef WebKitConsoleMessage_h
+#define WebKitConsoleMessage_h
+
+#include &lt;glib-object.h&gt;
+#include &lt;webkit2/WebKitDefines.h&gt;
+
+G_BEGIN_DECLS
+
+#define WEBKIT_TYPE_CONSOLE_MESSAGE (webkit_console_message_get_type())
+
+/**
+ * WebKitConsoleMessageSource:
+ * @WEBKIT_CONSOLE_MESSAGE_SOURCE_JAVASCRIPT: Message produced by JavaScript.
+ * @WEBKIT_CONSOLE_MESSAGE_SOURCE_NETWORK: Network messages.
+ * @WEBKIT_CONSOLE_MESSAGE_SOURCE_CONSOLE_API: Messages produced by console API.
+ * @WEBKIT_CONSOLE_MESSAGE_SOURCE_SECURITY: Security messages.
+ * @WEBKIT_CONSOLE_MESSAGE_SOURCE_OTHER: Other messages.
+ *
+ * Enum values used to denote the various sources of console messages.
+ *
+ * Since: 2.12
+ */
+typedef enum {
+    WEBKIT_CONSOLE_MESSAGE_SOURCE_JAVASCRIPT,
+    WEBKIT_CONSOLE_MESSAGE_SOURCE_NETWORK,
+    WEBKIT_CONSOLE_MESSAGE_SOURCE_CONSOLE_API,
+    WEBKIT_CONSOLE_MESSAGE_SOURCE_SECURITY,
+    WEBKIT_CONSOLE_MESSAGE_SOURCE_OTHER
+} WebKitConsoleMessageSource;
+
+/**
+ * WebKitConsoleMessageLevel:
+ * @WEBKIT_CONSOLE_MESSAGE_LEVEL_INFO: Information message.
+ * @WEBKIT_CONSOLE_MESSAGE_LEVEL_LOG: Log message.
+ * @WEBKIT_CONSOLE_MESSAGE_LEVEL_WARNING: Warning message.
+ * @WEBKIT_CONSOLE_MESSAGE_LEVEL_ERROR: Error message.
+ * @WEBKIT_CONSOLE_MESSAGE_LEVEL_DEBUG: Debug message.
+ *
+ * Enum values used to denote the various levels of console messages.
+ *
+ * Since: 2.12
+ */
+typedef enum {
+    WEBKIT_CONSOLE_MESSAGE_LEVEL_INFO,
+    WEBKIT_CONSOLE_MESSAGE_LEVEL_LOG,
+    WEBKIT_CONSOLE_MESSAGE_LEVEL_WARNING,
+    WEBKIT_CONSOLE_MESSAGE_LEVEL_ERROR,
+    WEBKIT_CONSOLE_MESSAGE_LEVEL_DEBUG
+} WebKitConsoleMessageLevel;
+
+typedef struct _WebKitConsoleMessage WebKitConsoleMessage;
+
+WEBKIT_API GType
+webkit_console_message_get_type      (void);
+
+WEBKIT_API WebKitConsoleMessage *
+webkit_console_message_copy          (WebKitConsoleMessage *console_message);
+
+WEBKIT_API void
+webkit_console_message_free          (WebKitConsoleMessage *console_message);
+
+WEBKIT_API WebKitConsoleMessageSource
+webkit_console_message_get_source    (WebKitConsoleMessage *console_message);
+
+WEBKIT_API WebKitConsoleMessageLevel
+webkit_console_message_get_level     (WebKitConsoleMessage *console_message);
+
+WEBKIT_API const gchar *
+webkit_console_message_get_text      (WebKitConsoleMessage *console_message);
+
+WEBKIT_API guint
+webkit_console_message_get_line      (WebKitConsoleMessage *console_message);
+
+WEBKIT_API const gchar *
+webkit_console_message_get_source_id (WebKitConsoleMessage *console_message);
+
+G_END_DECLS
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleAPIgtkWebKitConsoleMessagePrivateh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitConsoleMessagePrivate.h (0 => 193620)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitConsoleMessagePrivate.h                                (rev 0)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitConsoleMessagePrivate.h        2015-12-07 11:56:25 UTC (rev 193620)
</span><span class="lines">@@ -0,0 +1,54 @@
</span><ins>+/*
+ * Copyright (C) 2015 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef WebKitConsoleMessagePrivate_h
+#define WebKitConsoleMessagePrivate_h
+
+#include &quot;WebKitConsoleMessage.h&quot;
+#include &lt;runtime/ConsoleTypes.h&gt;
+#include &lt;wtf/text/CString.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+struct _WebKitConsoleMessage {
+    _WebKitConsoleMessage(JSC::MessageSource source, JSC::MessageLevel level, const String&amp; message, unsigned lineNumber, const String&amp; sourceID)
+        : source(source)
+        , level(level)
+        , message(message.utf8())
+        , lineNumber(lineNumber)
+        , sourceID(sourceID.utf8())
+    {
+    }
+
+    _WebKitConsoleMessage(WebKitConsoleMessage* consoleMessage)
+        : source(consoleMessage-&gt;source)
+        , level(consoleMessage-&gt;level)
+        , message(consoleMessage-&gt;message)
+        , lineNumber(consoleMessage-&gt;lineNumber)
+        , sourceID(consoleMessage-&gt;sourceID)
+    {
+    }
+
+    JSC::MessageSource source;
+    JSC::MessageLevel level;
+    CString message;
+    unsigned lineNumber;
+    CString sourceID;
+};
+
+#endif // WebKitConsoleMessagePrivate_h
</ins></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleAPIgtkWebKitWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp (193619 => 193620)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp        2015-12-07 11:46:28 UTC (rev 193619)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp        2015-12-07 11:56:25 UTC (rev 193620)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> #include &quot;WKBundleFrame.h&quot;
</span><span class="cx"> #include &quot;WebContextMenuItem.h&quot;
</span><span class="cx"> #include &quot;WebImage.h&quot;
</span><ins>+#include &quot;WebKitConsoleMessagePrivate.h&quot;
</ins><span class="cx"> #include &quot;WebKitContextMenuPrivate.h&quot;
</span><span class="cx"> #include &quot;WebKitDOMDocumentPrivate.h&quot;
</span><span class="cx"> #include &quot;WebKitFramePrivate.h&quot;
</span><span class="lines">@@ -49,6 +50,7 @@
</span><span class="cx"> #include &lt;glib/gi18n-lib.h&gt;
</span><span class="cx"> #include &lt;wtf/NeverDestroyed.h&gt;
</span><span class="cx"> #include &lt;wtf/text/CString.h&gt;
</span><ins>+#include &lt;wtf/text/StringBuilder.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> using namespace WebKit;
</span><span class="cx"> using namespace WebCore;
</span><span class="lines">@@ -57,6 +59,7 @@
</span><span class="cx">     DOCUMENT_LOADED,
</span><span class="cx">     SEND_REQUEST,
</span><span class="cx">     CONTEXT_MENU,
</span><ins>+    CONSOLE_MESSAGE_SENT,
</ins><span class="cx"> 
</span><span class="cx">     LAST_SIGNAL
</span><span class="cx"> };
</span><span class="lines">@@ -144,6 +147,12 @@
</span><span class="cx">     g_object_notify(G_OBJECT(webPage), &quot;uri&quot;);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static void webkitWebPageDidSendConsoleMessage(WebKitWebPage* webPage, MessageSource source, MessageLevel level, const String&amp; message, unsigned lineNumber, const String&amp; sourceID)
+{
+    WebKitConsoleMessage consoleMessage(source, level, message, lineNumber, sourceID);
+    g_signal_emit(webPage, signals[CONSOLE_MESSAGE_SENT], 0, &amp;consoleMessage);
+}
+
</ins><span class="cx"> static void didStartProvisionalLoadForFrame(WKBundlePageRef, WKBundleFrameRef frame, WKTypeRef*, const void *clientInfo)
</span><span class="cx"> {
</span><span class="cx">     if (!WKBundleFrameIsMainFrame(frame))
</span><span class="lines">@@ -219,13 +228,25 @@
</span><span class="cx">     return toAPI(&amp;newRequest.leakRef());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void didReceiveResponseForResource(WKBundlePageRef page, WKBundleFrameRef, uint64_t identifier, WKURLResponseRef response, const void*)
</del><ins>+static void didReceiveResponseForResource(WKBundlePageRef page, WKBundleFrameRef, uint64_t identifier, WKURLResponseRef response, const void* clientInfo)
</ins><span class="cx"> {
</span><span class="cx">     API::Dictionary::MapType message;
</span><span class="cx">     message.set(String::fromUTF8(&quot;Page&quot;), toImpl(page));
</span><span class="cx">     message.set(String::fromUTF8(&quot;Identifier&quot;), API::UInt64::create(identifier));
</span><span class="cx">     message.set(String::fromUTF8(&quot;Response&quot;), toImpl(response));
</span><span class="cx">     WebProcess::singleton().injectedBundle()-&gt;postMessage(String::fromUTF8(&quot;WebPage.DidReceiveResponseForResource&quot;), API::Dictionary::create(WTF::move(message)).ptr());
</span><ins>+
+    // Post on the console as well to be consistent with the inspector.
+    const ResourceResponse&amp; resourceResponse = toImpl(response)-&gt;resourceResponse();
+    if (resourceResponse.httpStatusCode() &gt;= 400) {
+        StringBuilder errorMessage;
+        errorMessage.appendLiteral(&quot;Failed to load resource: the server responded with a status of &quot;);
+        errorMessage.appendNumber(resourceResponse.httpStatusCode());
+        errorMessage.appendLiteral(&quot; (&quot;);
+        errorMessage.append(resourceResponse.httpStatusText());
+        errorMessage.append(')');
+        webkitWebPageDidSendConsoleMessage(WEBKIT_WEB_PAGE(clientInfo), MessageSource::Network, MessageLevel::Error, errorMessage.toString(), 0, resourceResponse.url().string());
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static void didReceiveContentLengthForResource(WKBundlePageRef page, WKBundleFrameRef, uint64_t identifier, uint64_t length, const void*)
</span><span class="lines">@@ -245,13 +266,25 @@
</span><span class="cx">     WebProcess::singleton().injectedBundle()-&gt;postMessage(String::fromUTF8(&quot;WebPage.DidFinishLoadForResource&quot;), API::Dictionary::create(WTF::move(message)).ptr());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void didFailLoadForResource(WKBundlePageRef page, WKBundleFrameRef, uint64_t identifier, WKErrorRef error, const void*)
</del><ins>+static void didFailLoadForResource(WKBundlePageRef page, WKBundleFrameRef, uint64_t identifier, WKErrorRef error, const void* clientInfo)
</ins><span class="cx"> {
</span><span class="cx">     API::Dictionary::MapType message;
</span><span class="cx">     message.set(String::fromUTF8(&quot;Page&quot;), toImpl(page));
</span><span class="cx">     message.set(String::fromUTF8(&quot;Identifier&quot;), API::UInt64::create(identifier));
</span><span class="cx">     message.set(String::fromUTF8(&quot;Error&quot;), toImpl(error));
</span><span class="cx">     WebProcess::singleton().injectedBundle()-&gt;postMessage(String::fromUTF8(&quot;WebPage.DidFailLoadForResource&quot;), API::Dictionary::create(WTF::move(message)).ptr());
</span><ins>+
+    // Post on the console as well to be consistent with the inspector.
+    const ResourceError&amp; resourceError = toImpl(error)-&gt;platformError();
+    if (!resourceError.isCancellation()) {
+        StringBuilder errorMessage;
+        errorMessage.appendLiteral(&quot;Failed to load resource&quot;);
+        if (!resourceError.localizedDescription().isEmpty()) {
+            errorMessage.appendLiteral(&quot;: &quot;);
+            errorMessage.append(resourceError.localizedDescription());
+        }
+        webkitWebPageDidSendConsoleMessage(WEBKIT_WEB_PAGE(clientInfo), MessageSource::Network, MessageLevel::Error, errorMessage.toString(), 0, resourceError.failingURL());
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> class PageContextMenuClient final : public API::InjectedBundle::PageContextMenuClient {
</span><span class="lines">@@ -283,6 +316,22 @@
</span><span class="cx">     WebKitWebPage* m_webPage;
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+class PageUIClient final : public API::InjectedBundle::PageUIClient {
+public:
+    explicit PageUIClient(WebKitWebPage* webPage)
+        : m_webPage(webPage)
+    {
+    }
+
+private:
+    void willAddMessageToConsole(WebPage*, MessageSource source, MessageLevel level, const String&amp; message, unsigned lineNumber, unsigned /*columnNumber*/, const String&amp; sourceID) override
+    {
+        webkitWebPageDidSendConsoleMessage(m_webPage, source, level, message, lineNumber, sourceID);
+    }
+
+    WebKitWebPage* m_webPage;
+};
+
</ins><span class="cx"> static void webkitWebPageGetProperty(GObject* object, guint propId, GValue* value, GParamSpec* paramSpec)
</span><span class="cx"> {
</span><span class="cx">     WebKitWebPage* webPage = WEBKIT_WEB_PAGE(object);
</span><span class="lines">@@ -395,6 +444,27 @@
</span><span class="cx">         G_TYPE_BOOLEAN, 2,
</span><span class="cx">         WEBKIT_TYPE_CONTEXT_MENU,
</span><span class="cx">         WEBKIT_TYPE_WEB_HIT_TEST_RESULT);
</span><ins>+
+    /**
+     * WebKitWebPage::console-message-sent:
+     * @web_page: the #WebKitWebPage on which the signal is emitted
+     * @console_message: the #WebKitConsoleMessage
+     *
+     * Emmited when a message is sent to the console. This can be a message
+     * produced by the use of JavaScript console API, a javascript exception,
+     * a security error or other errors, warnings, debug or log messages.
+     * The @console_message contains information of the message.
+     *
+     * Since: 2.12
+     */
+    signals[CONSOLE_MESSAGE_SENT] = g_signal_new(
+        &quot;console-message-sent&quot;,
+        G_TYPE_FROM_CLASS(klass),
+        G_SIGNAL_RUN_LAST,
+        0, 0, nullptr,
+        g_cclosure_marshal_VOID__BOXED,
+        G_TYPE_NONE, 1,
+        WEBKIT_TYPE_CONSOLE_MESSAGE | G_SIGNAL_TYPE_STATIC_SCOPE);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> WebPage* webkitWebPageGetPage(WebKitWebPage *webPage)
</span><span class="lines">@@ -466,6 +536,7 @@
</span><span class="cx">     WKBundlePageSetResourceLoadClient(toAPI(webPage), &amp;resourceLoadClient.base);
</span><span class="cx"> 
</span><span class="cx">     webPage-&gt;setInjectedBundleContextMenuClient(std::make_unique&lt;PageContextMenuClient&gt;(page));
</span><ins>+    webPage-&gt;setInjectedBundleUIClient(std::make_unique&lt;PageUIClient&gt;(page));
</ins><span class="cx"> 
</span><span class="cx">     return page;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleAPIgtkwebkitwebextensionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h (193619 => 193620)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h        2015-12-07 11:46:28 UTC (rev 193619)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h        2015-12-07 11:56:25 UTC (rev 193620)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> 
</span><span class="cx"> #define __WEBKIT_WEB_EXTENSION_H_INSIDE__
</span><span class="cx"> 
</span><ins>+#include &lt;webkit2/WebKitConsoleMessage.h&gt;
</ins><span class="cx"> #include &lt;webkit2/WebKitContextMenu.h&gt;
</span><span class="cx"> #include &lt;webkit2/WebKitContextMenuActions.h&gt;
</span><span class="cx"> #include &lt;webkit2/WebKitContextMenuItem.h&gt;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleInjectedBundlePageUIClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp (193619 => 193620)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp        2015-12-07 11:46:28 UTC (rev 193619)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp        2015-12-07 11:56:25 UTC (rev 193620)
</span><span class="lines">@@ -44,7 +44,7 @@
</span><span class="cx">     initialize(client);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void InjectedBundlePageUIClient::willAddMessageToConsole(WebPage* page, const String&amp; message, int32_t lineNumber)
</del><ins>+void InjectedBundlePageUIClient::willAddMessageToConsole(WebPage* page, MessageSource, MessageLevel, const String&amp; message, unsigned lineNumber, unsigned /*columnNumber*/, const String&amp; /*sourceID*/)
</ins><span class="cx"> {
</span><span class="cx">     if (m_client.willAddMessageToConsole)
</span><span class="cx">         m_client.willAddMessageToConsole(toAPI(page), toAPI(message.impl()), lineNumber, m_client.base.clientInfo);
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleInjectedBundlePageUIClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.h (193619 => 193620)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.h        2015-12-07 11:46:28 UTC (rev 193619)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.h        2015-12-07 11:56:25 UTC (rev 193620)
</span><span class="lines">@@ -47,7 +47,7 @@
</span><span class="cx"> public:
</span><span class="cx">     explicit InjectedBundlePageUIClient(const WKBundlePageUIClientBase*);
</span><span class="cx"> 
</span><del>-    void willAddMessageToConsole(WebPage*, const String&amp; message, int32_t lineNumber) override;
</del><ins>+    void willAddMessageToConsole(WebPage*, MessageSource, MessageLevel, const String&amp; message, unsigned lineNumber, unsigned columnNumber, const String&amp; sourceID) override;
</ins><span class="cx">     void willSetStatusbarText(WebPage*, const String&amp;) override;
</span><span class="cx">     void willRunJavaScriptAlert(WebPage*, const String&amp;, WebFrame*) override;
</span><span class="cx">     void willRunJavaScriptConfirm(WebPage*, const String&amp;, WebFrame*) override;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportWebChromeClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp (193619 => 193620)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp        2015-12-07 11:46:28 UTC (rev 193619)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp        2015-12-07 11:56:25 UTC (rev 193620)
</span><span class="lines">@@ -319,12 +319,10 @@
</span><span class="cx">     m_page-&gt;send(Messages::WebPageProxy::SetIsResizable(resizable));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebChromeClient::addMessageToConsole(MessageSource, MessageLevel, const String&amp; message, unsigned lineNumber, unsigned /*columnNumber*/, const String&amp; /*sourceID*/)
</del><ins>+void WebChromeClient::addMessageToConsole(MessageSource source, MessageLevel level, const String&amp; message, unsigned lineNumber, unsigned columnNumber, const String&amp; sourceID)
</ins><span class="cx"> {
</span><span class="cx">     // Notify the bundle client.
</span><del>-    m_page-&gt;injectedBundleUIClient().willAddMessageToConsole(m_page, message, lineNumber);
-
-    notImplemented();
</del><ins>+    m_page-&gt;injectedBundleUIClient().willAddMessageToConsole(m_page, source, level, message, lineNumber, columnNumber, sourceID);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool WebChromeClient::canRunBeforeUnloadConfirmPanel()
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (193619 => 193620)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2015-12-07 11:46:28 UTC (rev 193619)
+++ trunk/Tools/ChangeLog        2015-12-07 11:56:25 UTC (rev 193620)
</span><span class="lines">@@ -1,3 +1,29 @@
</span><ins>+2015-12-07  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
+
+        [GTK] Add WebKitWebPage::console-message-sent signal to Web Extensions API
+        https://bugs.webkit.org/show_bug.cgi?id=79918
+
+        Reviewed by Gustavo Noronha Silva.
+
+        Add unit tests to check the different console messages.
+
+        * TestWebKitAPI/Tests/WebKit2Gtk/CMakeLists.txt:
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestConsoleMessage.cpp: Added.
+        (ConsoleMessageTest::ConsoleMessage::operator==):
+        (ConsoleMessageTest::consoleMessageReceivedCallback):
+        (ConsoleMessageTest::ConsoleMessageTest):
+        (ConsoleMessageTest::~ConsoleMessageTest):
+        (ConsoleMessageTest::waitUntilConsoleMessageReceived):
+        (testWebKitConsoleMessageConsoleAPI):
+        (testWebKitConsoleMessageJavaScriptException):
+        (testWebKitConsoleMessageNetworkError):
+        (testWebKitConsoleMessageSecurityError):
+        (beforeAll):
+        (afterAll):
+        * TestWebKitAPI/Tests/WebKit2Gtk/WebExtensionTest.cpp:
+        (consoleMessageSentCallback):
+        (pageCreatedCallback):
+
</ins><span class="cx"> 2015-12-07  Ryuan Choi  &lt;ryuan.choi@navercorp.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [EFL] MiniBrowser doesn't exit when called ewk_view_try_close()
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2GtkCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/CMakeLists.txt (193619 => 193620)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/CMakeLists.txt        2015-12-07 11:46:28 UTC (rev 193619)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/CMakeLists.txt        2015-12-07 11:56:25 UTC (rev 193620)
</span><span class="lines">@@ -127,6 +127,7 @@
</span><span class="cx"> ADD_WK2_TEST(TestWebKitWebView TestWebKitWebView.cpp)
</span><span class="cx"> ADD_WK2_TEST(TestWebKitUserContentManager TestWebKitUserContentManager.cpp)
</span><span class="cx"> ADD_WK2_TEST(TestEditor TestEditor.cpp)
</span><ins>+ADD_WK2_TEST(TestConsoleMessage TestConsoleMessage.cpp)
</ins><span class="cx"> 
</span><span class="cx"> if (ATSPI_FOUND)
</span><span class="cx">     ADD_WK2_TEST(AccessibilityTestServer AccessibilityTestServer.cpp)
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2GtkTestConsoleMessagecpp"></a>
<div class="addfile"><h4>Added: trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestConsoleMessage.cpp (0 => 193620)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestConsoleMessage.cpp                                (rev 0)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestConsoleMessage.cpp        2015-12-07 11:56:25 UTC (rev 193620)
</span><span class="lines">@@ -0,0 +1,158 @@
</span><ins>+/*
+ * Copyright (C) 2015 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2,1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include &quot;config.h&quot;
+
+#include &quot;WebViewTest.h&quot;
+#include &lt;gtk/gtk.h&gt;
+#include &lt;webkit2/webkit2.h&gt;
+
+class ConsoleMessageTest : public WebViewTest {
+public:
+    MAKE_GLIB_TEST_FIXTURE(ConsoleMessageTest);
+
+    // This should be keep in sync with the public enums in WebKitConsoleMessage.h.
+    enum class MessageSource { JavaScript, Network, ConsoleAPI, Security, Other };
+    enum class MessageLevel { Info, Log, Warning, Error, Debug };
+    struct ConsoleMessage {
+        bool operator==(const ConsoleMessage&amp; other)
+        {
+            return source == other.source
+                &amp;&amp; level == other.level
+                &amp;&amp; message == other.message
+                &amp;&amp; lineNumber == other.lineNumber
+                &amp;&amp; sourceID == other.sourceID;
+        }
+
+        MessageSource source;
+        MessageLevel level;
+        CString message;
+        unsigned lineNumber;
+        CString sourceID;
+    };
+
+    static void consoleMessageReceivedCallback(WebKitUserContentManager*, WebKitJavascriptResult* message, ConsoleMessageTest* test)
+    {
+        g_assert(message);
+        GUniquePtr&lt;char&gt; messageString(WebViewTest::javascriptResultToCString(message));
+        GRefPtr&lt;GVariant&gt; variant = g_variant_parse(G_VARIANT_TYPE(&quot;(uusus)&quot;), messageString.get(), nullptr, nullptr, nullptr);
+        g_assert(variant.get());
+
+        unsigned source, level, lineNumber;
+        const char* messageText;
+        const char* sourceID;
+        g_variant_get(variant.get(), &quot;(uu&amp;su&amp;s)&quot;, &amp;source, &amp;level, &amp;messageText, &amp;lineNumber, &amp;sourceID);
+        test-&gt;m_consoleMessage = { static_cast&lt;ConsoleMessageTest::MessageSource&gt;(source), static_cast&lt;ConsoleMessageTest::MessageLevel&gt;(level), messageText, lineNumber, sourceID };
+
+        g_main_loop_quit(test-&gt;m_mainLoop);
+    }
+
+    ConsoleMessageTest()
+        : WebViewTest(webkit_user_content_manager_new())
+    {
+        WebKitUserContentManager* manager = webkit_web_view_get_user_content_manager(m_webView);
+        webkit_user_content_manager_register_script_message_handler(manager, &quot;console&quot;);
+        g_signal_connect(manager, &quot;script-message-received::console&quot;, G_CALLBACK(consoleMessageReceivedCallback), this);
+    }
+
+    ~ConsoleMessageTest()
+    {
+        WebKitUserContentManager* manager = webkit_web_view_get_user_content_manager(m_webView);
+        g_signal_handlers_disconnect_matched(manager, G_SIGNAL_MATCH_DATA, 0, 0, nullptr, nullptr, this);
+        webkit_user_content_manager_unregister_script_message_handler(manager, &quot;console&quot;);
+    }
+
+    void waitUntilConsoleMessageReceived()
+    {
+        g_main_loop_run(m_mainLoop);
+    }
+
+    ConsoleMessage m_consoleMessage;
+};
+
+static void testWebKitConsoleMessageConsoleAPI(ConsoleMessageTest* test, gconstpointer)
+{
+    ConsoleMessageTest::ConsoleMessage referenceMessage = { ConsoleMessageTest::MessageSource::ConsoleAPI, ConsoleMessageTest::MessageLevel::Log, &quot;Log Console Message&quot;, 1, &quot;http://foo.com/bar&quot; };
+    test-&gt;loadHtml(&quot;&lt;html&gt;&lt;body onload='console.log(\&quot;Log Console Message\&quot;);'&gt;&lt;/body&gt;&lt;/html&gt;&quot;, &quot;http://foo.com/bar&quot;);
+    test-&gt;waitUntilConsoleMessageReceived();
+    g_assert(test-&gt;m_consoleMessage == referenceMessage);
+
+    referenceMessage.level = ConsoleMessageTest::MessageLevel::Info;
+    referenceMessage.message = &quot;Info Console Message&quot;;
+    test-&gt;loadHtml(&quot;&lt;html&gt;&lt;body onload='console.info(\&quot;Info Console Message\&quot;);'&gt;&lt;/body&gt;&lt;/html&gt;&quot;, &quot;http://foo.com/bar&quot;);
+    test-&gt;waitUntilConsoleMessageReceived();
+    g_assert(test-&gt;m_consoleMessage == referenceMessage);
+
+    referenceMessage.level = ConsoleMessageTest::MessageLevel::Warning;
+    referenceMessage.message = &quot;Warning Console Message&quot;;
+    test-&gt;loadHtml(&quot;&lt;html&gt;&lt;body onload='console.warn(\&quot;Warning Console Message\&quot;);'&gt;&lt;/body&gt;&lt;/html&gt;&quot;, &quot;http://foo.com/bar&quot;);
+    test-&gt;waitUntilConsoleMessageReceived();
+    g_assert(test-&gt;m_consoleMessage == referenceMessage);
+
+    referenceMessage.level = ConsoleMessageTest::MessageLevel::Error;
+    referenceMessage.message = &quot;Error Console Message&quot;;
+    test-&gt;loadHtml(&quot;&lt;html&gt;&lt;body onload='console.error(\&quot;Error Console Message\&quot;);'&gt;&lt;/body&gt;&lt;/html&gt;&quot;, &quot;http://foo.com/bar&quot;);
+    test-&gt;waitUntilConsoleMessageReceived();
+    g_assert(test-&gt;m_consoleMessage == referenceMessage);
+
+    referenceMessage.level = ConsoleMessageTest::MessageLevel::Debug;
+    referenceMessage.message = &quot;Debug Console Message&quot;;
+    test-&gt;loadHtml(&quot;&lt;html&gt;&lt;body onload='console.debug(\&quot;Debug Console Message\&quot;);'&gt;&lt;/body&gt;&lt;/html&gt;&quot;, &quot;http://foo.com/bar&quot;);
+    test-&gt;waitUntilConsoleMessageReceived();
+    g_assert(test-&gt;m_consoleMessage == referenceMessage);
+}
+
+static void testWebKitConsoleMessageJavaScriptException(ConsoleMessageTest* test, gconstpointer)
+{
+    ConsoleMessageTest::ConsoleMessage referenceMessage = { ConsoleMessageTest::MessageSource::JavaScript, ConsoleMessageTest::MessageLevel::Error,
+        &quot;ReferenceError: Can't find variable: foo&quot;, 1, &quot;http://foo.com/bar&quot; };
+    test-&gt;loadHtml(&quot;&lt;html&gt;&lt;body onload='foo()'&gt;&lt;/body&gt;&lt;/html&gt;&quot;, &quot;http://foo.com/bar&quot;);
+    test-&gt;waitUntilConsoleMessageReceived();
+    g_assert(test-&gt;m_consoleMessage == referenceMessage);
+}
+
+static void testWebKitConsoleMessageNetworkError(ConsoleMessageTest* test, gconstpointer)
+{
+    ConsoleMessageTest::ConsoleMessage referenceMessage = { ConsoleMessageTest::MessageSource::Network, ConsoleMessageTest::MessageLevel::Error,
+        &quot;Failed to load resource: Error opening file: No such file or directory&quot;, 0, &quot;file:///foo/not-found.css&quot; };
+    test-&gt;loadHtml(&quot;&lt;html&gt;&lt;head&gt;&lt;link rel='stylesheet' href='not-found.css' type='text/css'&gt;&lt;/head&gt;&lt;body&gt;&lt;/body&gt;&lt;/html&gt;&quot;, &quot;file:///foo/bar&quot;);
+    test-&gt;waitUntilConsoleMessageReceived();
+    g_assert(test-&gt;m_consoleMessage == referenceMessage);
+}
+
+static void testWebKitConsoleMessageSecurityError(ConsoleMessageTest* test, gconstpointer)
+{
+    ConsoleMessageTest::ConsoleMessage referenceMessage = { ConsoleMessageTest::MessageSource::Security, ConsoleMessageTest::MessageLevel::Error,
+        &quot;Not allowed to load local resource: file:///foo/bar/source.png&quot;, 1, &quot;http://foo.com/bar&quot; };
+    test-&gt;loadHtml(&quot;&lt;html&gt;&lt;body&gt;&lt;img src=\&quot;file:///foo/bar/source.png\&quot;/&gt;&lt;/body&gt;&lt;/html&gt;&quot;, &quot;http://foo.com/bar&quot;);
+    test-&gt;waitUntilConsoleMessageReceived();
+    g_assert(test-&gt;m_consoleMessage == referenceMessage);
+}
+
+void beforeAll()
+{
+    ConsoleMessageTest::add(&quot;WebKitConsoleMessage&quot;, &quot;console-api&quot;, testWebKitConsoleMessageConsoleAPI);
+    ConsoleMessageTest::add(&quot;WebKitConsoleMessage&quot;, &quot;js-exception&quot;, testWebKitConsoleMessageJavaScriptException);
+    ConsoleMessageTest::add(&quot;WebKitConsoleMessage&quot;, &quot;network-error&quot;, testWebKitConsoleMessageNetworkError);
+    ConsoleMessageTest::add(&quot;WebKitConsoleMessage&quot;, &quot;security-error&quot;, testWebKitConsoleMessageSecurityError);
+}
+
+void afterAll()
+{
+}
</ins></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2GtkWebExtensionTestcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/WebExtensionTest.cpp (193619 => 193620)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/WebExtensionTest.cpp        2015-12-07 11:46:28 UTC (rev 193619)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/WebExtensionTest.cpp        2015-12-07 11:56:25 UTC (rev 193620)
</span><span class="lines">@@ -226,12 +226,25 @@
</span><span class="cx">     return FALSE;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static void consoleMessageSentCallback(WebKitWebPage* webPage, WebKitConsoleMessage* consoleMessage)
+{
+    g_assert(consoleMessage);
+    GRefPtr&lt;GVariant&gt; variant = g_variant_new(&quot;(uusus)&quot;, webkit_console_message_get_source(consoleMessage),
+        webkit_console_message_get_level(consoleMessage), webkit_console_message_get_text(consoleMessage),
+        webkit_console_message_get_line(consoleMessage), webkit_console_message_get_source_id(consoleMessage));
+    GUniquePtr&lt;char&gt; messageString(g_variant_print(variant.get(), FALSE));
+    GRefPtr&lt;WebKitDOMDOMWindow&gt; window = adoptGRef(webkit_dom_document_get_default_view(webkit_web_page_get_dom_document(webPage)));
+    g_assert(WEBKIT_DOM_IS_DOM_WINDOW(window.get()));
+    webkit_dom_dom_window_webkit_message_handlers_post_message(window.get(), &quot;console&quot;, messageString.get());
+}
+
</ins><span class="cx"> static void pageCreatedCallback(WebKitWebExtension* extension, WebKitWebPage* webPage, gpointer)
</span><span class="cx"> {
</span><span class="cx">     g_signal_connect(webPage, &quot;document-loaded&quot;, G_CALLBACK(documentLoadedCallback), extension);
</span><span class="cx">     g_signal_connect(webPage, &quot;notify::uri&quot;, G_CALLBACK(uriChangedCallback), extension);
</span><span class="cx">     g_signal_connect(webPage, &quot;send-request&quot;, G_CALLBACK(sendRequestCallback), nullptr);
</span><span class="cx">     g_signal_connect(webPage, &quot;context-menu&quot;, G_CALLBACK(contextMenuCallback), nullptr);
</span><ins>+    g_signal_connect(webPage, &quot;console-message-sent&quot;, G_CALLBACK(consoleMessageSentCallback), nullptr);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static JSValueRef echoCallback(JSContextRef jsContext, JSObjectRef, JSObjectRef, size_t argumentCount, const JSValueRef arguments[], JSValueRef*)
</span></span></pre>
</div>
</div>

</body>
</html>