https://bugs.webkit.org/show_bug.cgi?id=121095
Patch by Andrzej Badowski <a.badowski@samsung.com> on 2014-06-09
Reviewed by Gyuyoung Kim.
-w (--web-security) commandline allows to disable/enable web security (enabled by default).
The reason for this is to test and debug (using, for example, MiniBrowser) scripts accessing
resources from other domains (cross-domain requests) such as access map location on another server.
Another possibility is to launch in a webkit browser local file tests that will refer to the links
in the http website loaded in an iframe. It will not be possible without deactivation of web security.
Source/WebKit2:
* UIProcess/API/efl/ewk_settings.cpp:
(ewk_settings_web_security_enabled_set):
(ewk_settings_web_security_enabled_get):
* UIProcess/API/efl/ewk_settings.h:
* UIProcess/API/efl/tests/test_ewk2_settings.cpp:
(TEST_F):
Tools:
* MiniBrowser/efl/main.c:
(window_create):
(elm_main):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@169688
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2014-06-09 Andrzej Badowski <a.badowski@samsung.com>
+
+ [EFL] Add parameter to MiniBrowser to disable web security
+ https://bugs.webkit.org/show_bug.cgi?id=121095
+
+ Reviewed by Gyuyoung Kim.
+
+ -w (--web-security) commandline allows to disable/enable web security (enabled by default).
+ The reason for this is to test and debug (using, for example, MiniBrowser) scripts accessing
+ resources from other domains (cross-domain requests) such as access map location on another server.
+ Another possibility is to launch in a webkit browser local file tests that will refer to the links
+ in the http website loaded in an iframe. It will not be possible without deactivation of web security.
+
+ * UIProcess/API/efl/ewk_settings.cpp:
+ (ewk_settings_web_security_enabled_set):
+ (ewk_settings_web_security_enabled_get):
+ * UIProcess/API/efl/ewk_settings.h:
+ * UIProcess/API/efl/tests/test_ewk2_settings.cpp:
+ (TEST_F):
+
2014-06-08 Sam Weinig <sam@webkit.org>
[Cocoa] WKScriptMessage should include the frame the message is from
#endif
}
+Eina_Bool ewk_settings_web_security_enabled_set(Ewk_Settings* settings, Eina_Bool enable)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
+
+ WKPreferencesSetWebSecurityEnabled(settings->preferences(), enable);
+
+ return true;
+}
+
+Eina_Bool ewk_settings_web_security_enabled_get(const Ewk_Settings* settings)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
+
+ return WKPreferencesGetWebSecurityEnabled(settings->preferences());
+}
+
Eina_Bool ewk_settings_spatial_navigation_enabled_set(Ewk_Settings* settings, Eina_Bool enable)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
EAPI Eina_Bool ewk_settings_text_autosizing_enabled_get(const Ewk_Settings *settings);
/**
+ * Enables/disables web security.
+ *
+ * By default, the web security is enabled.
+ *
+ * @param settings settings object to set the web security
+ * @param enable @c EINA_TRUE to enable the web security
+ * @c EINA_FALSE to disable
+ *
+ * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
+ *
+ * @see ewk_settings_web_security_enabled_get()
+ */
+EAPI Eina_Bool ewk_settings_web_security_enabled_set(Ewk_Settings *settings, Eina_Bool enable);
+
+/**
+ * Returns whether the web security is enabled.
+ *
+ * @param settings settings object to query whether web security is enabled
+ *
+ * @return @c EINA_TRUE if the web security is enabled
+ * @c EINA_FALSE if not or on failure
+ */
+EAPI Eina_Bool ewk_settings_web_security_enabled_get(const Ewk_Settings *settings);
+
+/**
* Changes spatial navigation state.
*
* @param settings settings object to enable/disable spatial navigation
#endif
}
+TEST_F(EWK2UnitTestBase, ewk_settings_web_security_enabled)
+{
+ Ewk_Settings* settings = ewk_view_settings_get(webView());
+
+ // Web security should be enabled by default.
+ ASSERT_TRUE(ewk_settings_web_security_enabled_get(settings));
+
+ ASSERT_TRUE(ewk_settings_web_security_enabled_set(settings, false));
+ ASSERT_FALSE(ewk_settings_web_security_enabled_get(settings));
+
+ ASSERT_TRUE(ewk_settings_web_security_enabled_set(settings, true));
+ ASSERT_TRUE(ewk_settings_web_security_enabled_get(settings));
+}
+
TEST_F(EWK2UnitTestBase, ewk_settings_spatial_navigation_enabled)
{
Ewk_Settings* settings = ewk_view_settings_get(webView());
+2014-06-09 Andrzej Badowski <a.badowski@samsung.com>
+
+ [EFL] Add parameter to MiniBrowser to disable web security
+ https://bugs.webkit.org/show_bug.cgi?id=121095
+
+ Reviewed by Gyuyoung Kim.
+
+ -w (--web-security) commandline allows to disable/enable web security (enabled by default).
+ The reason for this is to test and debug (using, for example, MiniBrowser) scripts accessing
+ resources from other domains (cross-domain requests) such as access map location on another server.
+ Another possibility is to launch in a webkit browser local file tests that will refer to the links
+ in the http website loaded in an iframe. It will not be possible without deactivation of web security.
+
+ * MiniBrowser/efl/main.c:
+ (window_create):
+ (elm_main):
+
2014-06-06 Simon Fraser <simon.fraser@apple.com>
32-bit build fix.
static Eina_Bool local_storage_enabled = EINA_TRUE;
static Eina_Bool fullscreen_enabled = EINA_FALSE;
static Eina_Bool spell_checking_enabled = EINA_FALSE;
+static Eina_Bool web_security_enabled = EINA_TRUE;
static Eina_Bool touch_events_enabled = EINA_FALSE;
static Eina_Bool fixed_layout_enabled = EINA_FALSE;
static Eina_Bool separated_process_enabled = EINA_FALSE;
ECORE_GETOPT_STORE_DEF_STR
('p', "policy-cookies", "Cookies policy:\n always - always accept,\n never - never accept,\n no-third-party - don't accept third-party cookies.", "no-third-party"),
ECORE_GETOPT_STORE_DEF_BOOL
+ ('w', "web-security", "enable/disable web security.", EINA_TRUE),
+ ECORE_GETOPT_STORE_DEF_BOOL
('S', "separate-process", "Create new window in separated web process.", EINA_TRUE),
ECORE_GETOPT_VERSION
('V', "version"),
ewk_settings_developer_extras_enabled_set(settings, EINA_TRUE);
ewk_settings_preferred_minimum_contents_width_set(settings, 0);
ewk_text_checker_continuous_spell_checking_enabled_set(spell_checking_enabled);
+ ewk_settings_web_security_enabled_set(settings, web_security_enabled);
evas_object_smart_callback_add(window->ewk_view, "authentication,request", on_authentication_request, window);
evas_object_smart_callback_add(window->ewk_view, "download,failed", on_download_failed, window);
ECORE_GETOPT_VALUE_BOOL(touch_events_enabled),
ECORE_GETOPT_VALUE_BOOL(fixed_layout_enabled),
ECORE_GETOPT_VALUE_STR(cookies_policy_string),
+ ECORE_GETOPT_VALUE_BOOL(web_security_enabled),
ECORE_GETOPT_VALUE_BOOL(separated_process_enabled),
ECORE_GETOPT_VALUE_BOOL(quitOption),
ECORE_GETOPT_VALUE_BOOL(quitOption),