diff options
author | fsamuel@chromium.org <fsamuel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-13 03:28:23 +0000 |
---|---|---|
committer | fsamuel@chromium.org <fsamuel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-13 03:28:23 +0000 |
commit | cfc7821418ec8759df693d7abd2fcb1be1aa24c6 (patch) | |
tree | 9992f1ac6ccd141dd63f96b3c2d15ca93737ee41 /extensions/common/extension_api.cc | |
parent | 9fac4e42bec7716471a67ade46e6420cc51be989 (diff) | |
download | chromium_src-cfc7821418ec8759df693d7abd2fcb1be1aa24c6.zip chromium_src-cfc7821418ec8759df693d7abd2fcb1be1aa24c6.tar.gz chromium_src-cfc7821418ec8759df693d7abd2fcb1be1aa24c6.tar.bz2 |
<webview>: Implement declarativeWebRequest API
This CL exposes the declarative WebRequest API to <webview>s.
This CL isolates rules registries on a per-<profile, embedder_process_id, webview_instance_id> tuple. For extensions, the pair <embedder_process_id, webview_instance_id> == <0, 0>.
Rules registries are now created on-demand rather than on creation of the RulesRegistryService. This is so that we only create rules registries for webviews if the webview adds rules. This also allows rules to be installed prior to initial navigation of a webview.
Sample code:
var webview = document.querySelector('webview');
var rule = {
conditions: [
new chrome.webViewRequest.RequestMatcher({ url: { hostSuffix: 'slashdot.org' } })
],
actions: [
new chrome.webViewRequest.CancelRequest()
]
};
webview.request.onRequest.addRules([rule])
BUG=273855
Review URL: https://codereview.chromium.org/28273006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@234724 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'extensions/common/extension_api.cc')
-rw-r--r-- | extensions/common/extension_api.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/extensions/common/extension_api.cc b/extensions/common/extension_api.cc index eda15ac..a8b2fa0 100644 --- a/extensions/common/extension_api.cc +++ b/extensions/common/extension_api.cc @@ -262,6 +262,9 @@ void ExtensionAPI::InitDefaultConfiguration() { RegisterSchemaResource("webstore", IDR_EXTENSION_API_JSON_WEBSTORE); RegisterSchemaResource("webstorePrivate", IDR_EXTENSION_API_JSON_WEBSTOREPRIVATE); + RegisterSchemaResource("webViewRequest", + IDR_EXTENSION_API_JSON_WEBVIEW_REQUEST); + default_configuration_initialized_ = true; } |