Feature Flags

WebKit provides a way to expose a feature flag to a client application at runtime, and have that application toggle the feature. This lets us to start work on experimental features without fully exposing them to the Web, but allows Web developers to turn them on and test. There are two types of exposed features: Experimental and Internal Debug.

The configuration file WebPreferences.yaml controls these features. Just set the category value to experimental or internal. Note that you should also provide a nice human-understandable description and name.

These are only exposed by WebKit2. If you want your feature to be toggled via WebKit1 you'll have to manually add more code.

Experimental Features

These features are designed for Web developers, and are exposed via Safari's Develop menu as well as MiniBrowser.

Internal Debug Features

These features are designed for WebKit developers, and are exposed via Safari's secret-but-not-really Debug menu. We do not expect Web developers to change their settings. They are also exposed by MiniBrowser.

Which should I use?

If a Web developer wouldn't understand what the feature is by name, or it is just for internal testing, then you should use an internal feature. For example, we don't want users to disable Service Workers, and almost no one would know what MDSN ICE Candidates are.

What about testing?

You can turn both experimental and internal features on via headers in WebKitTestRunner. Use experimental:FeatureName or internal:FeatureName. For example...

<!-- webkit-test-runner [ experimental:WebAnimationsCSSIntegrationEnabled=true ] -->
Last modified 5 years ago Last modified on Sep 12, 2018 2:45:34 PM