Diff
Modified: trunk/Source/WebKit/ChangeLog (256108 => 256109)
--- trunk/Source/WebKit/ChangeLog 2020-02-10 02:04:36 UTC (rev 256108)
+++ trunk/Source/WebKit/ChangeLog 2020-02-10 04:47:15 UTC (rev 256109)
@@ -1,3 +1,24 @@
+2020-02-09 Lauro Moura <[email protected]>
+
+ [GTK][WPE] Expose allowTopNavigationToDataURL
+ https://bugs.webkit.org/show_bug.cgi?id=207384
+
+ Reviewed by Adrian Perez de Castro.
+
+ This patch exposes the new property "allow-top-navigation-to-data-urls"
+ from r255961 to the glib-based APIs.
+
+ * UIProcess/API/glib/WebKitSettings.cpp:
+ (webKitSettingsSetProperty): Set new property.
+ (webKitSettingsGetProperty): Get new property.
+ (webkit_settings_class_init): Register new property.
+ (webkit_settings_get_allow_top_navigation_to_data_urls): Added.
+ (webkit_settings_set_allow_top_navigation_to_data_urls): Added.
+ * UIProcess/API/gtk/WebKitSettings.h:
+ * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
+ * UIProcess/API/wpe/WebKitSettings.h:
+ * UIProcess/API/wpe/docs/wpe-1.0-sections.txt:
+
2020-02-09 Keith Rollin <[email protected]>
Re-enable LTO for ARM builds
Modified: trunk/Source/WebKit/UIProcess/API/glib/WebKitSettings.cpp (256108 => 256109)
--- trunk/Source/WebKit/UIProcess/API/glib/WebKitSettings.cpp 2020-02-10 02:04:36 UTC (rev 256108)
+++ trunk/Source/WebKit/UIProcess/API/glib/WebKitSettings.cpp 2020-02-10 04:47:15 UTC (rev 256109)
@@ -163,6 +163,7 @@
PROP_ENABLE_MEDIA_CAPABILITIES,
PROP_ALLOW_FILE_ACCESS_FROM_FILE_URLS,
PROP_ALLOW_UNIVERSAL_ACCESS_FROM_FILE_URLS,
+ PROP_ALLOW_TOP_NAVIGATION_TO_DATA_URLS,
#if PLATFORM(GTK)
PROP_HARDWARE_ACCELERATION_POLICY,
PROP_ENABLE_BACK_FORWARD_NAVIGATION_GESTURES,
@@ -382,6 +383,9 @@
case PROP_ALLOW_UNIVERSAL_ACCESS_FROM_FILE_URLS:
webkit_settings_set_allow_universal_access_from_file_urls(settings, g_value_get_boolean(value));
break;
+ case PROP_ALLOW_TOP_NAVIGATION_TO_DATA_URLS:
+ webkit_settings_set_allow_top_navigation_to_data_urls(settings, g_value_get_boolean(value));
+ break;
#if PLATFORM(GTK)
case PROP_HARDWARE_ACCELERATION_POLICY:
webkit_settings_set_hardware_acceleration_policy(settings, static_cast<WebKitHardwareAccelerationPolicy>(g_value_get_enum(value)));
@@ -570,6 +574,9 @@
case PROP_ALLOW_UNIVERSAL_ACCESS_FROM_FILE_URLS:
g_value_set_boolean(value, webkit_settings_get_allow_universal_access_from_file_urls(settings));
break;
+ case PROP_ALLOW_TOP_NAVIGATION_TO_DATA_URLS:
+ g_value_set_boolean(value, webkit_settings_get_allow_top_navigation_to_data_urls(settings));
+ break;
#if PLATFORM(GTK)
case PROP_HARDWARE_ACCELERATION_POLICY:
g_value_set_enum(value, webkit_settings_get_hardware_acceleration_policy(settings));
@@ -1436,6 +1443,24 @@
FALSE,
readWriteConstructParamFlags));
+ /**
+ * WebKitSettings:allow-top-navigation-to-data-urls:
+ *
+ * Whether or not the top frame is allowed to navigate to data URLs. It is disabled by default
+ * due to the risk it poses when loading untrusted URLs, with data URLs being used in scamming
+ * and phishing attacks. In contrast, a scenario where it could be enabled could be an app that
+ * embeds a WebView and you have control of the pages being show instead of a generic browser.
+ *
+ * Since: 2.28
+ */
+ g_object_class_install_property(gObjectClass,
+ PROP_ALLOW_TOP_NAVIGATION_TO_DATA_URLS,
+ g_param_spec_boolean("allow-top-navigation-to-data-urls",
+ _("Allow top frame navigation to data URLs"),
+ _("Whether or not top frame navigation is allowed to data URLs"),
+ FALSE,
+ readWriteConstructParamFlags));
+
#if PLATFORM(GTK)
/**
* WebKitSettings:hardware-acceleration-policy:
@@ -3500,6 +3525,45 @@
g_object_notify(G_OBJECT(settings), "allow-universal-access-from-file-urls");
}
+/**
+ * webkit_settings_get_allow_top_navigation_to_data_urls:
+ * @settings: a #WebKitSettings
+ *
+ * Get the #WebKitSettings:allow-top-navigation-to-data-urls property.
+ *
+ * Returns: %TRUE If navigation to data URLs from the top frame is allowed or %FALSE\
+ * otherwise.
+ *
+ * Since: 2.28
+ */
+gboolean webkit_settings_get_allow_top_navigation_to_data_urls(WebKitSettings* settings)
+{
+ g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
+
+ return settings->priv->preferences->allowTopNavigationToDataURLs();
+}
+
+/**
+ * webkit_settings_set_allow_top_navigation_to_data_urls:
+ * @settings: a #WebKitSettings
+ * @allowed: Value to be set
+ *
+ * Set the #WebKitSettings:allow-top-navigation-to-data-urls property.
+ *
+ * Since: 2.28
+ */
+void webkit_settings_set_allow_top_navigation_to_data_urls(WebKitSettings* settings, gboolean allowed)
+{
+ g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
+
+ WebKitSettingsPrivate* priv = settings->priv;
+ if (priv->preferences->allowTopNavigationToDataURLs() == allowed)
+ return;
+
+ priv->preferences->setAllowTopNavigationToDataURLs(allowed);
+ g_object_notify(G_OBJECT(settings), "allow-top-navigation-to-data-urls");
+}
+
#if PLATFORM(GTK)
/**
* webkit_settings_get_hardware_acceleration_policy:
Modified: trunk/Source/WebKit/UIProcess/API/gtk/WebKitSettings.h (256108 => 256109)
--- trunk/Source/WebKit/UIProcess/API/gtk/WebKitSettings.h 2020-02-10 02:04:36 UTC (rev 256108)
+++ trunk/Source/WebKit/UIProcess/API/gtk/WebKitSettings.h 2020-02-10 04:47:15 UTC (rev 256109)
@@ -465,6 +465,13 @@
webkit_settings_set_allow_universal_access_from_file_urls (WebKitSettings *settings,
gboolean allowed);
+WEBKIT_API gboolean
+webkit_settings_get_allow_top_navigation_to_data_urls (WebKitSettings *settings);
+
+WEBKIT_API void
+webkit_settings_set_allow_top_navigation_to_data_urls (WebKitSettings *settings,
+ gboolean allowed);
+
WEBKIT_API WebKitHardwareAccelerationPolicy
webkit_settings_get_hardware_acceleration_policy (WebKitSettings *settings);
Modified: trunk/Source/WebKit/UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt (256108 => 256109)
--- trunk/Source/WebKit/UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt 2020-02-10 02:04:36 UTC (rev 256108)
+++ trunk/Source/WebKit/UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt 2020-02-10 04:47:15 UTC (rev 256109)
@@ -536,6 +536,8 @@
webkit_settings_set_allow_file_access_from_file_urls
webkit_settings_get_allow_universal_access_from_file_urls
webkit_settings_set_allow_universal_access_from_file_urls
+webkit_settings_get_allow_top_navigation_to_data_urls
+webkit_settings_set_allow_top_navigation_to_data_urls
webkit_settings_get_hardware_acceleration_policy
webkit_settings_set_hardware_acceleration_policy
webkit_settings_get_enable_back_forward_navigation_gestures
Modified: trunk/Source/WebKit/UIProcess/API/wpe/WebKitSettings.h (256108 => 256109)
--- trunk/Source/WebKit/UIProcess/API/wpe/WebKitSettings.h 2020-02-10 02:04:36 UTC (rev 256108)
+++ trunk/Source/WebKit/UIProcess/API/wpe/WebKitSettings.h 2020-02-10 04:47:15 UTC (rev 256109)
@@ -443,6 +443,13 @@
gboolean allowed);
WEBKIT_API gboolean
+webkit_settings_get_allow_top_navigation_to_data_urls (WebKitSettings *settings);
+
+WEBKIT_API void
+webkit_settings_set_allow_top_navigation_to_data_urls (WebKitSettings *settings,
+ gboolean allowed);
+
+WEBKIT_API gboolean
webkit_settings_get_enable_javascript_markup (WebKitSettings *settings);
WEBKIT_API void
Modified: trunk/Source/WebKit/UIProcess/API/wpe/docs/wpe-1.0-sections.txt (256108 => 256109)
--- trunk/Source/WebKit/UIProcess/API/wpe/docs/wpe-1.0-sections.txt 2020-02-10 02:04:36 UTC (rev 256108)
+++ trunk/Source/WebKit/UIProcess/API/wpe/docs/wpe-1.0-sections.txt 2020-02-10 04:47:15 UTC (rev 256109)
@@ -538,6 +538,8 @@
webkit_settings_set_allow_file_access_from_file_urls
webkit_settings_get_allow_universal_access_from_file_urls
webkit_settings_set_allow_universal_access_from_file_urls
+webkit_settings_get_allow_top_navigation_to_data_urls
+webkit_settings_set_allow_top_navigation_to_data_urls
webkit_settings_get_enable_media
webkit_settings_set_enable_media
Modified: trunk/Tools/ChangeLog (256108 => 256109)
--- trunk/Tools/ChangeLog 2020-02-10 02:04:36 UTC (rev 256108)
+++ trunk/Tools/ChangeLog 2020-02-10 04:47:15 UTC (rev 256109)
@@ -1,3 +1,18 @@
+2020-02-09 Lauro Moura <[email protected]>
+
+ [GTK][WPE] Expose allowTopNavigationToDataURL
+ https://bugs.webkit.org/show_bug.cgi?id=207384
+
+ Reviewed by Adrian Perez de Castro.
+
+ Updates with new "allow-top-navigation-to-data-urls" property.
+
+ * TestWebKitAPI/Tests/WebKitGLib/TestUIClient.cpp:
+ (testWebViewAllowModalDialogs): This test requires this property to be
+ set.
+ * TestWebKitAPI/Tests/WebKitGLib/TestWebKitSettings.cpp:
+ (testWebKitSettings): Added tests for getter/setter.
+
2020-02-08 Sam Weinig <[email protected]>
Move _javascript_Core related feature defines from FeatureDefines.xcconfig to PlatformEnableCocoa.h
Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestUIClient.cpp (256108 => 256109)
--- trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestUIClient.cpp 2020-02-10 02:04:36 UTC (rev 256108)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestUIClient.cpp 2020-02-10 04:47:15 UTC (rev 256109)
@@ -531,6 +531,7 @@
{
WebKitSettings* settings = webkit_web_view_get_settings(test->m_webView);
webkit_settings_set_allow_modal_dialogs(settings, TRUE);
+ webkit_settings_set_allow_top_navigation_to_data_urls(settings, TRUE);
test->loadHtml("<html><body _onload_=\"window.showModalDialog('data:text/html,<html><body/><script>window.close();</script></html>')\"></body></html>", 0);
test->waitUntilMainLoopFinishes();
Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitSettings.cpp (256108 => 256109)
--- trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitSettings.cpp 2020-02-10 02:04:36 UTC (rev 256108)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitSettings.cpp 2020-02-10 04:47:15 UTC (rev 256109)
@@ -331,6 +331,11 @@
webkit_settings_set_allow_universal_access_from_file_urls(settings, TRUE);
g_assert_true(webkit_settings_get_allow_universal_access_from_file_urls(settings));
+ // Top frame navigation to data url is not allowed by default.
+ g_assert_false(webkit_settings_get_allow_top_navigation_to_data_urls(settings));
+ webkit_settings_set_allow_top_navigation_to_data_urls(settings, TRUE);
+ g_assert_true(webkit_settings_get_allow_top_navigation_to_data_urls(settings));
+
// Media is enabled by default.
g_assert_true(webkit_settings_get_enable_media(settings));
webkit_settings_set_enable_media(settings, FALSE);