Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 3.0 License, and code samples are licensed under the BSD License.
?2013 Google
このページは大阪弁化フィルタによって翻訳生成されたんですわ。 |
Description: |
The chrome.types API contains type declarations for Chrome.
|
Availability: |
Stable since Chrome 13.
|
The ChromeSetting
prototype provides a common set of functions
(get()
, set()
, and clear()
) as
well as an event publisher (onChange
) for settings of the
Chrome browser. The proxy settings
examples demonstrate how these functions are intended to be used.
Chrome distinguishes between three different scopes of browser settings:
regular
regular
scope apply to regular
browser windows and are inherited by incognito windows if they are not
overwritten. These settings are stored to disk and remain in place until
they are cleared by the governing extension, or the governing extension is
disabled or uninstalled.incognito_persistent
incognito_persistent
scope apply only
to incognito windows. For these, they override regular
settings. These settings are stored to disk and remain in place until
they are cleared by the governing extension, or the governing extension is
disabled or uninstalled.incognito_session_only
incognito_session_only
scope apply only
to incognito windows. For these, they override regular
and
incognito_session_only
settings. These settings are not
stored to disk and are cleared when the last incognito window is closed. They
can only be set when at least one incognito window is open.Chrome manages settings on different layers. The following list describes the layers that may influence the effective settings, in increasing order of precedence.
As the list implies, policies might overrule any changes that you specify with
your extension. You can use the get()
function to determine whether
your extension is capable of providing a setting or whether this setting would
be overridden.
As discussed above, Chrome allows using different settings for regular windows and incognito windows. The following example illustrates the behavior. Assume that no policy overrides the settings and that an extension can set settings for regular windows (R) and settings for incognito windows (I).
If two or more extensions want to set the same setting to different values, the extension installed most recently takes precedence over the other extensions. If the most recently installed extension sets only (I), the settings of regular windows can be defined by previously installed extensions.
The effective value of a setting is the one that results from considering the precedence rules. It is used by Chrome.
Gets the value of a setting.
The callback parameter should specify a function that looks like this:
function(object details) {...};
"not_controllable"
, "controlled_by_other_extensions"
, "controllable_by_this_extension"
, or "controlled_by_this_extension"
)
Sets the value of a setting.
"regular"
, "regular_only"
, "incognito_persistent"
, or "incognito_session_only"
)
If you specify the callback parameter, it should specify a function that looks like this:
function() {...};
Clears the setting, restoring any default value.
"regular"
, "regular_only"
, "incognito_persistent"
, or "incognito_session_only"
)
If you specify the callback parameter, it should specify a function that looks like this:
function() {...};
Fired after the setting changes.
The callback parameter should specify a function that looks like this:
function(object details) {...};
"not_controllable"
, "controlled_by_other_extensions"
, "controllable_by_this_extension"
, or "controlled_by_this_extension"
)