@@ -15037,7 +15037,7 @@ index 62629b4c1c25ae82bd797b39bbf9de0331f8eed2..5de7900a29b0e629f1ac404bbb0dc5b4
15037
15037
15038
15038
typedef struct _BrowserWindow BrowserWindow;
15039
15039
diff --git a/Tools/MiniBrowser/gtk/main.c b/Tools/MiniBrowser/gtk/main.c
15040
- index 61cb729e9e8e24d85c0d678c64a3dbae1c085f63..0efc11a6565ce3e4ec8e5bea6e12216f9d04e4c1 100644
15040
+ index 61cb729e9e8e24d85c0d678c64a3dbae1c085f63..52f1f175cfd5c0e73cd74eca95a46b085ac98b37 100644
15041
15041
--- a/Tools/MiniBrowser/gtk/main.c
15042
15042
+++ b/Tools/MiniBrowser/gtk/main.c
15043
15043
@@ -55,7 +55,12 @@ static const char *cookiesPolicy;
@@ -15064,7 +15064,7 @@ index 61cb729e9e8e24d85c0d678c64a3dbae1c085f63..0efc11a6565ce3e4ec8e5bea6e12216f
15064
15064
{ G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &uriArguments, 0, "[URL…]" },
15065
15065
{ 0, 0, 0, 0, 0, 0, 0 }
15066
15066
};
15067
- @@ -530,6 +539,41 @@ static void filterSavedCallback(WebKitUserContentFilterStore *store, GAsyncResul
15067
+ @@ -530,6 +539,48 @@ static void filterSavedCallback(WebKitUserContentFilterStore *store, GAsyncResul
15068
15068
g_main_loop_quit(data->mainLoop);
15069
15069
}
15070
15070
@@ -15094,28 +15094,34 @@ index 61cb729e9e8e24d85c0d678c64a3dbae1c085f63..0efc11a6565ce3e4ec8e5bea6e12216f
15094
15094
+ g_application_release(G_APPLICATION(browserApplication));
15095
15095
+}
15096
15096
+
15097
+ +static void keepApplicationAliveUntilQuit(GApplication *application)
15098
+ +{
15099
+ + // Reference the application, it will be released in quitBroserApplication.
15100
+ + g_application_hold(application);
15101
+ + WebKitBrowserInspector* browserInspector = webkit_browser_inspector_get_default();
15102
+ + g_signal_connect(browserInspector, "quit-application", G_CALLBACK(quitBroserApplication), NULL);
15103
+ +}
15104
+ +
15097
15105
+static void configureBrowserInspectorPipe()
15098
15106
+{
15099
15107
+ WebKitBrowserInspector* browserInspector = webkit_browser_inspector_get_default();
15100
15108
+ g_signal_connect(browserInspector, "create-new-page", G_CALLBACK(createNewPage), NULL);
15101
- + g_signal_connect(browserInspector, "quit-application", G_CALLBACK(quitBroserApplication), NULL);
15102
15109
+
15103
15110
+ webkit_browser_inspector_initialize_pipe(proxy, ignoreHosts);
15104
15111
+}
15105
15112
+
15106
15113
static void startup(GApplication *application)
15107
15114
{
15108
15115
const char *actionAccels[] = {
15109
- @@ -560,23 +604,37 @@ static void startup(GApplication *application)
15116
+ @@ -560,23 +611,36 @@ static void startup(GApplication *application)
15110
15117
15111
15118
static void activate(GApplication *application, WebKitSettings *webkitSettings)
15112
15119
{
15113
15120
+ if (inspectorPipe)
15114
15121
+ configureBrowserInspectorPipe();
15115
15122
+
15116
15123
+ if (noStartupWindow) {
15117
- + // Reference the application, it will be released in quitBroserApplication.
15118
- + g_application_hold(application);
15124
+ + keepApplicationAliveUntilQuit(application);
15119
15125
+ g_clear_object(&webkitSettings);
15120
15126
+ return;
15121
15127
+ }
@@ -15147,7 +15153,7 @@ index 61cb729e9e8e24d85c0d678c64a3dbae1c085f63..0efc11a6565ce3e4ec8e5bea6e12216f
15147
15153
g_object_unref(manager);
15148
15154
15149
15155
if (cookiesPolicy) {
15150
- @@ -595,7 +653 ,7 @@ static void activate(GApplication *application, WebKitSettings *webkitSettings)
15156
+ @@ -595,7 +659 ,7 @@ static void activate(GApplication *application, WebKitSettings *webkitSettings)
15151
15157
}
15152
15158
15153
15159
if (proxy) {
@@ -15156,7 +15162,7 @@ index 61cb729e9e8e24d85c0d678c64a3dbae1c085f63..0efc11a6565ce3e4ec8e5bea6e12216f
15156
15162
webkit_web_context_set_network_proxy_settings(webContext, WEBKIT_NETWORK_PROXY_MODE_CUSTOM, webkitProxySettings);
15157
15163
webkit_network_proxy_settings_free(webkitProxySettings);
15158
15164
}
15159
- @@ -661,9 +719 ,7 @@ static void activate(GApplication *application, WebKitSettings *webkitSettings)
15165
+ @@ -661,9 +725 ,7 @@ static void activate(GApplication *application, WebKitSettings *webkitSettings)
15160
15166
WebKitWebView *webView = createBrowserTab(mainWindow, webkitSettings, userContentManager, defaultWebsitePolicies);
15161
15167
if (!i)
15162
15168
firstTab = GTK_WIDGET(webView);
@@ -15167,7 +15173,7 @@ index 61cb729e9e8e24d85c0d678c64a3dbae1c085f63..0efc11a6565ce3e4ec8e5bea6e12216f
15167
15173
}
15168
15174
} else {
15169
15175
WebKitWebView *webView = createBrowserTab(mainWindow, webkitSettings, userContentManager, defaultWebsitePolicies);
15170
- @@ -739,9 +795 ,11 @@ int main(int argc, char *argv[])
15176
+ @@ -739,9 +801 ,11 @@ int main(int argc, char *argv[])
15171
15177
}
15172
15178
15173
15179
GtkApplication *application = gtk_application_new(NULL, G_APPLICATION_FLAGS_NONE);
0 commit comments