The BrowserSetting.onChanged event is fired when the setting is changed.

Syntax

BrowserSetting.onChanged.addListener(listener)
BrowserSetting.onChanged.removeListener(listener)
BrowserSetting.onChanged.hasListener(listener)

Events have three functions:

addListener(listener)
Adds a listener to this event.
removeListener(listener)
Stop listening to this event. The listener argument is the listener to remove.
hasListener(listener)
Check whether listener is registered for this event. Returns true if it is listening, false otherwise.

addListener syntax

Parameters

callback

A callback function that will be called when this event occurs. The function will be passed the following arguments:

details
An object containing details of the change that occurred. Its properties are as follows:
value
The new value of the setting. The type of this property is determined by the particular setting.
levelOfControl
string. This represents the way the setting is currently controlled. You can use it to check whether you can modify the setting. See BrowserSetting.set() for details. Its value may be any of the following:
"not_controllable" Extensions are not allowed to modify this setting.
"controlled_by_other_extensions" Another extension that was installed after this one has modified this setting.
"controllable_by_this_extension" This extension is allowed to modify the setting.
controlled_by_this_extension" This extension has already modified the setting.

Browser compatibility

See types.BrowserSetting.

Examples

Acknowledgements

This API is based on Chromium's chrome.types API.

Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License.

Document Tags and Contributors

 Contributors to this page: andrewtruongmoz, wbamberg, jwhitlock
 Last updated by: andrewtruongmoz,