Skip to content

Commit d2bfe00

Browse files
aslushnikovyury-s
authored andcommitted
browser(webkit): fix setOfflineMode (#656)
1 parent f03b648 commit d2bfe00

File tree

2 files changed

+42
-7
lines changed

2 files changed

+42
-7
lines changed

browser_patches/webkit/BUILD_NUMBER

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1112
1+
1113

browser_patches/webkit/patches/bootstrap.diff

Lines changed: 41 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11508,6 +11508,30 @@ index 935a7fd136754694c5301100ad4699ccb2210e67..2a04380900326ec5ef03ff5b78c67643
1150811508

1150911509
# Experimental features
1151011510
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_APPLICATION_MANIFEST PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES})
11511+
diff --git a/Tools/MiniBrowser/gtk/BrowserTab.c b/Tools/MiniBrowser/gtk/BrowserTab.c
11512+
index 9e9978efd3d821c7afcd7b65e14c64e36b355802..ab97c2301577989461aadc853055076d8dfab451 100644
11513+
--- a/Tools/MiniBrowser/gtk/BrowserTab.c
11514+
+++ b/Tools/MiniBrowser/gtk/BrowserTab.c
11515+
@@ -147,6 +147,11 @@ static void loadChanged(WebKitWebView *webView, WebKitLoadEvent loadEvent, Brows
11516+
gtk_container_foreach(GTK_CONTAINER(tab), (GtkCallback)removeChildIfInfoBar, tab);
11517+
}
11518+
11519+
+static void loadFailed()
11520+
+{
11521+
+ return TRUE;
11522+
+}
11523+
+
11524+
static GtkWidget *createInfoBarQuestionMessage(const char *title, const char *text)
11525+
{
11526+
GtkWidget *dialog = gtk_info_bar_new_with_buttons("No", GTK_RESPONSE_NO, "Yes", GTK_RESPONSE_YES, NULL);
11527+
@@ -457,6 +462,7 @@ static void browserTabConstructed(GObject *gObject)
11528+
g_signal_connect(tab->webView, "notify::is-loading", G_CALLBACK(isLoadingChanged), tab);
11529+
g_signal_connect(tab->webView, "decide-policy", G_CALLBACK(decidePolicy), tab);
11530+
g_signal_connect(tab->webView, "load-changed", G_CALLBACK(loadChanged), tab);
11531+
+ g_signal_connect(tab->webView, "load-failed", G_CALLBACK(loadFailed), tab);
11532+
g_signal_connect(tab->webView, "load-failed-with-tls-errors", G_CALLBACK(loadFailedWithTLSerrors), tab);
11533+
g_signal_connect(tab->webView, "permission-request", G_CALLBACK(decidePermissionRequest), tab);
11534+
g_signal_connect(tab->webView, "run-color-chooser", G_CALLBACK(runColorChooserCallback), tab);
1151111535
diff --git a/Tools/MiniBrowser/gtk/BrowserWindow.h b/Tools/MiniBrowser/gtk/BrowserWindow.h
1151211536
index 1570d65effb5d601ee3c44a2a7461436f4691c2c..456f96cf589320efa70a76f76e230b6795886b5a 100644
1151311537
--- a/Tools/MiniBrowser/gtk/BrowserWindow.h
@@ -12183,7 +12207,7 @@ index 245f319abf2595e154d03e1ee8b3250d7f46aafd..9cae87b23deade7c163f34aade2b2aed
1218312207
${WPEBACKEND_FDO_INCLUDE_DIRS}
1218412208
)
1218512209
diff --git a/Tools/MiniBrowser/wpe/main.cpp b/Tools/MiniBrowser/wpe/main.cpp
12186-
index 2d183d394123bd84545dc51f53eb9be796fb8873..249c35ffd8344212cb11aec4e2b7e6396ce0a2fd 100644
12210+
index 2d183d394123bd84545dc51f53eb9be796fb8873..05df1b0713cd6c7cf22d8f3a298d86364fdbc5e6 100644
1218712211
--- a/Tools/MiniBrowser/wpe/main.cpp
1218812212
+++ b/Tools/MiniBrowser/wpe/main.cpp
1218912213
@@ -25,7 +25,7 @@
@@ -12222,7 +12246,17 @@ index 2d183d394123bd84545dc51f53eb9be796fb8873..249c35ffd8344212cb11aec4e2b7e639
1222212246
return std::make_unique<WPEToolingBackends::WindowViewBackend>(width, height);
1222312247
}
1222412248

12225-
@@ -152,7 +156,23 @@ static void webViewClose(WebKitWebView* webView, gpointer)
12249+
@@ -147,12 +151,33 @@ static void filterSavedCallback(WebKitUserContentFilterStore *store, GAsyncResul
12250+
g_main_loop_quit(data->mainLoop);
12251+
}
12252+
12253+
+static gboolean webViewLoadFailed()
12254+
+{
12255+
+ return TRUE;
12256+
+}
12257+
+
12258+
static void webViewClose(WebKitWebView* webView, gpointer)
12259+
{
1222612260
g_object_unref(webView);
1222712261
}
1222812262

@@ -12247,7 +12281,7 @@ index 2d183d394123bd84545dc51f53eb9be796fb8873..249c35ffd8344212cb11aec4e2b7e639
1224712281
{
1224812282
auto backend = createViewBackend(1280, 720);
1224912283
struct wpe_view_backend* wpeBackend = backend->backend();
12250-
@@ -164,14 +184,54 @@ static WebKitWebView* createWebView(WebKitWebView* webView, WebKitNavigationActi
12284+
@@ -164,14 +189,55 @@ static WebKitWebView* createWebView(WebKitWebView* webView, WebKitNavigationActi
1225112285
delete static_cast<WPEToolingBackends::ViewBackend*>(data);
1225212286
}, backend.release());
1225312287

@@ -12272,6 +12306,7 @@ index 2d183d394123bd84545dc51f53eb9be796fb8873..249c35ffd8344212cb11aec4e2b7e639
1227212306

1227312307
g_signal_connect(newWebView, "close", G_CALLBACK(webViewClose), nullptr);
1227412308
-
12309+
+ g_signal_connect(newWebView, "load-failed", G_CALLBACK(webViewLoadFailed), nullptr);
1227512310
+ g_signal_connect(newWebView, "script-dialog", G_CALLBACK(scriptDialog), nullptr);
1227612311
+ g_signal_connect(newWebView, "script-dialog-handled", G_CALLBACK(scriptDialogHandled), nullptr);
1227712312
+ g_signal_connect(newWebView, "create", G_CALLBACK(createWebView), nullptr);
@@ -12305,7 +12340,7 @@ index 2d183d394123bd84545dc51f53eb9be796fb8873..249c35ffd8344212cb11aec4e2b7e639
1230512340
int main(int argc, char *argv[])
1230612341
{
1230712342
#if ENABLE_DEVELOPER_MODE
12308-
@@ -215,7 +275,18 @@ int main(int argc, char *argv[])
12343+
@@ -215,7 +281,18 @@ int main(int argc, char *argv[])
1230912344
return 1;
1231012345
}
1231112346

@@ -12325,7 +12360,7 @@ index 2d183d394123bd84545dc51f53eb9be796fb8873..249c35ffd8344212cb11aec4e2b7e639
1232512360

1232612361
if (cookiesPolicy) {
1232712362
auto* cookieManager = webkit_web_context_get_cookie_manager(webContext);
12328-
@@ -280,6 +351,9 @@ int main(int argc, char *argv[])
12363+
@@ -280,6 +357,9 @@ int main(int argc, char *argv[])
1232912364
delete static_cast<WPEToolingBackends::ViewBackend*>(data);
1233012365
}, backend.release());
1233112366

@@ -12335,7 +12370,7 @@ index 2d183d394123bd84545dc51f53eb9be796fb8873..249c35ffd8344212cb11aec4e2b7e639
1233512370
auto* webView = WEBKIT_WEB_VIEW(g_object_new(WEBKIT_TYPE_WEB_VIEW,
1233612371
"backend", viewBackend,
1233712372
"web-context", webContext,
12338-
@@ -318,7 +392,7 @@ int main(int argc, char *argv[])
12373+
@@ -318,7 +398,7 @@ int main(int argc, char *argv[])
1233912374
g_object_unref(file);
1234012375
webkit_web_view_load_uri(webView, url);
1234112376
g_free(url);

0 commit comments

Comments
 (0)