OLD | NEW |
1 <h2 id="manifest">Manifest</h2> | 1 <h2 id="manifest">Manifest</h2> |
2 <p>You must declare the "contentSettings" permission | 2 <p>You must declare the "contentSettings" permission |
3 in your extension's manifest to use the API. | 3 in your extension's manifest to use the API. |
4 For example:</p> | 4 For example:</p> |
5 <pre data-filename="manifest.json"> | 5 <pre data-filename="manifest.json"> |
6 { | 6 { |
7 "name": "My extension", | 7 "name": "My extension", |
8 ... | 8 ... |
9 <b>"permissions": [ | 9 <b>"permissions": [ |
10 "contentSettings" | 10 "contentSettings" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 <td><code><all_urls></code>, </td> | 108 <td><code><all_urls></code>, </td> |
109 <td><code><all_urls></code></td> | 109 <td><code><all_urls></code></td> |
110 </tr> | 110 </tr> |
111 </table> | 111 </table> |
112 | 112 |
113 <h2 id="resource-identifiers">Resource identifiers</h2> | 113 <h2 id="resource-identifiers">Resource identifiers</h2> |
114 <p> | 114 <p> |
115 Resource identifiers allow you to specify content settings for specific | 115 Resource identifiers allow you to specify content settings for specific |
116 subtypes of a content type. Currently, the only content type that supports | 116 subtypes of a content type. Currently, the only content type that supports |
117 resource identifiers is $(ref:contentSettings.plugins), | 117 resource identifiers is $(ref:contentSettings.plugins), |
118 where a resource identifier identifies a specific plug-in. When applying content | 118 where a resource identifier identifies a specific plugin. When applying content |
119 settings, first the settings for the specific plug-in are checked. If there are | 119 settings, first the settings for the specific plugin are checked. If there are |
120 no settings found for the specific plug-in, the general content settings for | 120 no settings found for the specific plugin, the general content settings for |
121 plug-ins are checked. | 121 plugins are checked. |
122 </p> | 122 </p> |
123 <p> | 123 <p> |
124 For example, if a content setting rule has the resource identifier | 124 For example, if a content setting rule has the resource identifier |
125 <code>adobe-flash-player</code> and the pattern <code><all_urls></code>, | 125 <code>adobe-flash-player</code> and the pattern <code><all_urls></code>, |
126 it takes precedence over a rule without a resource identifier and the pattern | 126 it takes precedence over a rule without a resource identifier and the pattern |
127 <code>http://www.example.com/*</code>, even if that pattern is more specific. | 127 <code>http://www.example.com/*</code>, even if that pattern is more specific. |
128 </p> | 128 </p> |
129 <p> | 129 <p> |
130 You can get a list of resource identifiers for a content type by calling the | 130 You can get a list of resource identifiers for a content type by calling the |
131 $(ref:contentSettings.ContentSetting.getResourceIdentifiers) method. The returne
d list | 131 $(ref:contentSettings.ContentSetting.getResourceIdentifiers) method. The returne
d list |
132 can change with the set of installed plug-ins on the user's machine, but Chrome | 132 can change with the set of installed plugins on the user's machine, but Chrome |
133 tries to keep the identifiers stable across plug-in updates. | 133 tries to keep the identifiers stable across plugin updates. |
134 </p> | 134 </p> |
135 | 135 |
136 <h2 id="examples">Examples</h2> | 136 <h2 id="examples">Examples</h2> |
137 | 137 |
138 <p> | 138 <p> |
139 You can find samples of this API on the | 139 You can find samples of this API on the |
140 <a href="samples#contentSettings">sample page</a>. | 140 <a href="samples#contentSettings">sample page</a>. |
141 </p> | 141 </p> |
OLD | NEW |