Skip to content

Commit d611ca9

Browse files
authored
browser(webkit): do not transform about:blank to about:///blank (#2221)
1 parent e96e471 commit d611ca9

File tree

2 files changed

+31
-9
lines changed

2 files changed

+31
-9
lines changed

browser_patches/webkit/BUILD_NUMBER

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1225
1+
1226

browser_patches/webkit/patches/bootstrap.diff

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14228,7 +14228,7 @@ index 1570d65effb5d601ee3c44a2a7461436f4691c2c..65e62adad0c3684e5cec2f6bc8e7f528
1422814228

1422914229
#endif
1423014230
diff --git a/Tools/MiniBrowser/gtk/main.c b/Tools/MiniBrowser/gtk/main.c
14231-
index 2ff45b938cffabe95fe17137393b8b6c506d4993..42676b3466da8db3ccafe9f8c1049b908b349c21 100644
14231+
index 2ff45b938cffabe95fe17137393b8b6c506d4993..bd28310341f4f47612dbbea350e83a6d182953c3 100644
1423214232
--- a/Tools/MiniBrowser/gtk/main.c
1423314233
+++ b/Tools/MiniBrowser/gtk/main.c
1423414234
@@ -54,6 +54,10 @@ static const char *cookiesFile;
@@ -14322,7 +14322,18 @@ index 2ff45b938cffabe95fe17137393b8b6c506d4993..42676b3466da8db3ccafe9f8c1049b90
1432214322
g_object_unref(manager);
1432314323

1432414324
if (cookiesPolicy) {
14325-
@@ -657,8 +713,7 @@ int main(int argc, char *argv[])
14325+
@@ -633,9 +689,7 @@ int main(int argc, char *argv[])
14326+
WebKitWebView *webView = createBrowserTab(mainWindow, webkitSettings, userContentManager);
14327+
if (!i)
14328+
firstTab = GTK_WIDGET(webView);
14329+
- gchar *url = argumentToURL(uriArguments[i]);
14330+
- webkit_web_view_load_uri(webView, url);
14331+
- g_free(url);
14332+
+ webkit_web_view_load_uri(webView, uriArguments[i]);
14333+
}
14334+
} else {
14335+
WebKitWebView *webView = createBrowserTab(mainWindow, webkitSettings, userContentManager);
14336+
@@ -657,8 +711,7 @@ int main(int argc, char *argv[])
1432614337

1432714338
browser_main();
1432814339

@@ -14333,7 +14344,7 @@ index 2ff45b938cffabe95fe17137393b8b6c506d4993..42676b3466da8db3ccafe9f8c1049b90
1433314344
return 0;
1433414345
}
1433514346
diff --git a/Tools/MiniBrowser/wpe/main.cpp b/Tools/MiniBrowser/wpe/main.cpp
14336-
index a8cccb6c1d567823fe8e6503f1a137856b0a9975..00b39f96b6b48dc0bd3df54659850dfc233ea0be 100644
14347+
index a8cccb6c1d567823fe8e6503f1a137856b0a9975..afded3b4c108dbc48397bcb7653795c432877057 100644
1433714348
--- a/Tools/MiniBrowser/wpe/main.cpp
1433814349
+++ b/Tools/MiniBrowser/wpe/main.cpp
1433914350
@@ -25,7 +25,7 @@
@@ -14510,16 +14521,27 @@ index a8cccb6c1d567823fe8e6503f1a137856b0a9975..00b39f96b6b48dc0bd3df54659850dfc
1451014521
webkit_web_context_set_automation_allowed(webContext, automationMode);
1451114522
g_signal_connect(webContext, "automation-started", G_CALLBACK(automationStartedCallback), webView);
1451214523
g_signal_connect(webView, "permission-request", G_CALLBACK(decidePermissionRequest), nullptr);
14513-
@@ -326,7 +407,7 @@ int main(int argc, char *argv[])
14514-
g_object_unref(file);
14515-
webkit_web_view_load_uri(webView, url);
14516-
g_free(url);
14524+
@@ -317,16 +398,9 @@ int main(int argc, char *argv[])
14525+
webkit_web_view_set_background_color(webView, &color);
14526+
14527+
if (uriArguments) {
14528+
- const char* uri = uriArguments[0];
14529+
- if (g_str_equal(uri, "about:gpu"))
14530+
- uri = "webkit://gpu";
14531+
-
14532+
- GFile* file = g_file_new_for_commandline_arg(uri);
14533+
- char* url = g_file_get_uri(file);
14534+
- g_object_unref(file);
14535+
- webkit_web_view_load_uri(webView, url);
14536+
- g_free(url);
1451714537
- } else if (automationMode)
14538+
+ // Playwright: avoid weird url transformation like http://trac.webkit.org/r240840
14539+
+ webkit_web_view_load_uri(webView, uriArguments[0]);
1451814540
+ } else if (automationMode || inspectorPipe)
1451914541
webkit_web_view_load_uri(webView, "about:blank");
1452014542
else
1452114543
webkit_web_view_load_uri(webView, "https://wpewebkit.org");
14522-
@@ -336,8 +417,7 @@ int main(int argc, char *argv[])
14544+
@@ -336,8 +410,7 @@ int main(int argc, char *argv[])
1452314545
g_hash_table_destroy(openViews);
1452414546

1452514547

0 commit comments

Comments
 (0)