]> khamidou — GitHub mirrors - electron.git/commitdiff
Make 'allow-displaying-insecure-content' and
authorHaojian Wu <hokein.wu@gmail.com>
Wed, 29 Jul 2015 10:07:06 +0000 (18:07 +0800)
committerHaojian Wu <hokein.wu@gmail.com>
Wed, 29 Jul 2015 10:08:44 +0000 (18:08 +0800)
'allow-running-insecure-content' higher priority than `web-security`.

atom/browser/native_window.cc
docs/api/browser-window.md

index ca5df45d17820fb8643f9b97188756c0a84d7131..ac3efc604e07132d40db4a20224d0297744f1804 100644 (file)
@@ -434,15 +434,15 @@ void NativeWindow::OverrideWebkitPrefs(content::WebPreferences* prefs) {
     prefs->experimental_webgl_enabled = b;
   if (web_preferences_.Get("webaudio", &b))
     prefs->webaudio_enabled = b;
-  if (web_preferences_.Get("allow-displaying-insecure-content", &b))
-    prefs->allow_displaying_insecure_content = b;
-  if (web_preferences_.Get("allow-running-insecure-content", &b))
-    prefs->allow_running_insecure_content = b;
   if (web_preferences_.Get("web-security", &b)) {
     prefs->web_security_enabled = b;
     prefs->allow_displaying_insecure_content = !b;
     prefs->allow_running_insecure_content = !b;
   }
+  if (web_preferences_.Get("allow-displaying-insecure-content", &b))
+    prefs->allow_displaying_insecure_content = b;
+  if (web_preferences_.Get("allow-running-insecure-content", &b))
+    prefs->allow_running_insecure_content = b;
   if (web_preferences_.Get("extra-plugin-dirs", &list)) {
     if (content::PluginService::GetInstance()->NPAPIPluginsSupported()) {
       for (size_t i = 0; i < list.size(); ++i)
index b6f25446076364c52a36cd47334b9ad27d8b20d4..f8830632caa616c251b8ab21e1ebead415b0459d 100644 (file)
@@ -77,14 +77,13 @@ You can also create a window without chrome by using
   * `web-preferences` Object - Settings of web page's features
     * `javascript` Boolean
     * `web-security` Boolean - When setting `false`, it will disable the same-origin
-      policy(Ususally using testing websites by people) and set `allow_displaying_insecure_content`
-      and `allow_running_insecure_content` to `true`.
+      policy(Usually using testing websites by people), and set `allow_displaying_insecure_content`
+      and `allow_running_insecure_content` to `true` if these two options are not
+      set by user.
     * `allow-displaying-insecure-content` Boolean - Allow a https page to display
-      content like image from http URLs. This option will be overrided to `true`
-      when `web-security` option is set.
+      content like image from http URLs.
     * `allow-running-insecure-content` Boolean - Allow a https page to run JavaScript,
-      CSS or plugins from http URLs. This option will be overrided to `true` when
-      `web-security` option is set.
+      CSS or plugins from http URLs.
     * `images` Boolean
     * `java` Boolean
     * `text-areas-are-resizable` Boolean