WebKit2.Feature

Fields

None

Methods

get_category ()

get_default_value ()

get_details ()

get_identifier ()

get_name ()

get_status ()

ref ()

unref ()

Details

class WebKit2.Feature

Describes a web engine feature that may be toggled at runtime.

The WebKit web engine includes a set of features which may be toggled programmatically, each one represented by a WebKit2.Feature that provides information about it:

  • A unique “identifier”: [method`Feature`.get_identifier].

  • A “default value”, which indicates whether the option is enabled automatically: [method`Feature`.get_default_value].

  • Its “status”, which determines whether it should be considered user-settable and its development stage (see [enum`FeatureStatus`] for details): [method`Feature`.get_status].

  • A category, which may be used to group features together: [method`Feature`.get_category].

  • An optional short “name” which can be presented to an user: [method`Feature`.get_name].

  • An optional longer “detailed” description: [method`Feature`.get_details].

The lists of available features can be obtained with [func`Settings`.get_all_features], [func`Settings`.get_experimental_features], and [func`Settings`.get_development_features]). As a rule of thumb, applications which may want to allow users (i.e. web developers) to test WebKit features should use the list of experimental features. Additionally, applications might want to expose development features *when targeting technically inclined users* for early testing of in-development features (i.e. in “technology preview” or “canary” builds).

Applications **must not** expose the list of all features to end users because they often lack descriptions and control parts of the web engine which are either intended to be used during development of WebKit itself, or in specific scenarios to tweak how WebKit integrates with the application.

New in version 2.42.

get_category()
Returns:

Feature category.

Return type:

str

Gets the category of the feature.

Applications which include user interface to toggle features may want to use the category to group related features together.

New in version 2.42.

get_default_value()
Returns:

Whether the feature is enabled by default.

Return type:

bool

Gets whether the feature is enabled by default.

The default value may be used by applications which include user interface to toggle features to restore its settings to their defaults. Note that whether a feature is actually enabled must be checked with [method`Settings`.get_feature_enabled].

New in version 2.42.

get_details()
Returns:

Feature description.

Return type:

str or None

Gets a description for the self.

The detailed description should be considered an additional clarification on the purpose of the feature, to be used as complementary aid to be displayed along the feature name returned by [method`Feature`.get_name]. The returned string is suitable to be displayed to end users, but it should not be relied upon being localized.

Note that some *features may not* have a detailed description, and None is returned in this case.

New in version 2.42.

get_identifier()
Returns:

The identifier string for the feature.

Return type:

str

Gets a string that uniquely identifies the self.

New in version 2.42.

get_name()
Returns:

Short feature name.

Return type:

str or None

Gets a short name for the self.

The returned string is suitable to be displayed to end users, but it should not be relied upon being localized.

Note that some *features may not* have a short name, and None is returned in this case.

New in version 2.42.

get_status()
Returns:

Feature status.

Return type:

WebKit2.FeatureStatus

Gets the status of the feature.

New in version 2.42.

ref()
Returns:

The same self with an additional reference.

Return type:

WebKit2.Feature

Atomically acquires a reference on the given self.

This function is MT-safe and may be called from any thread.

New in version 2.42.

unref()

Atomically releases a reference on the given self.

If the reference was the last, the resources associated to the self are freed. This function is MT-safe and may be called from any thread.

New in version 2.42.