]> khamidou — GitHub mirrors - electron.git/commitdiff
Add blinkFeatures option
authorCheng Zhao <zcbenz@gmail.com>
Thu, 7 Jan 2016 06:10:18 +0000 (14:10 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Thu, 7 Jan 2016 06:10:18 +0000 (14:10 +0800)
atom/browser/web_contents_preferences.cc
atom/common/options_switches.cc
atom/common/options_switches.h
docs/api/browser-window.md

index 03003a563a19602ec717d0d198c3d33ad7778d62..c75b0daaff48a6ef0da8c740a596f651ccf21984 100644 (file)
@@ -116,6 +116,12 @@ void WebContentsPreferences::AppendExtraCommandLineSwitches(
   if (web_preferences.GetInteger(options::kOpenerID, &opener_id))
       command_line->AppendSwitchASCII(switches::kOpenerID,
                                       base::IntToString(opener_id));
+
+  // Enable blink features.
+  std::string blink_features;
+  if (web_preferences.GetString(options::kBlinkFeatures, &blink_features))
+      command_line->AppendSwitchASCII(::switches::kEnableBlinkFeatures,
+                                      blink_features);
 }
 
 // static
index a62af41e16cabf71313692234a0d39602e8aab31..6c4e8477cc4adde020759f9618d85960375432ec 100644 (file)
@@ -88,13 +88,16 @@ const char kGuestInstanceID[] = "guestInstanceId";
 // Enable DirectWrite on Windows.
 const char kDirectWrite[] = "directWrite";
 
-// Opener window's ID.
-const char kOpenerID[] = "openerId";
-
 // Web runtime features.
 const char kExperimentalFeatures[]       = "experimentalFeatures";
 const char kExperimentalCanvasFeatures[] = "experimentalCanvasFeatures";
 
+// Opener window's ID.
+const char kOpenerID[] = "openerId";
+
+// Enable blink features.
+const char kBlinkFeatures[] = "blinkFeatures";
+
 }  // namespace options
 
 namespace switches {
index ef860b6aeacc0a1ea629c2fffd05b81202127671..f038521673a0ad3e34c2508285091ae5be95ca54 100644 (file)
@@ -50,6 +50,7 @@ extern const char kGuestInstanceID[];
 extern const char kExperimentalFeatures[];
 extern const char kExperimentalCanvasFeatures[];
 extern const char kOpenerID[];
+extern const char kBlinkFeatures[];
 
 }   // namespace options
 
index 6dc52576677aba1ae39c848893010d57eadb79f4..8511ca7a5655f89e7ae8aa11b22db1039f8489a3 100644 (file)
@@ -138,6 +138,10 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
     canvas features. Default is `false`.
   * `directWrite` Boolean - Enables DirectWrite font rendering system on
      Windows. Default is `true`.
+  * `blinkFeatures` String - A list of feature strings separated by `,`, like
+    `CSSVariables,KeyboardEventKey`. The full list of supported feature strings
+    can be found in the [setFeatureEnabledFromString][blink-feature-string]
+    function.
 
 ## Events
 
@@ -750,3 +754,5 @@ Returns whether the window is visible on all workspaces.
 * `ignore` Boolean
 
 Ignore all moused events that happened in the window.
+
+[blink-feature-string]: https://code.google.com/p/chromium/codesearch#chromium/src/out/Debug/gen/blink/platform/RuntimeEnabledFeatures.cpp&sq=package:chromium&type=cs&l=527