Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1220)

Unified Diff: chrome/common/extensions/api/declarative_content.json

Issue 11547033: Implement declarativeContent API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix vabr's comments; make GetMatches const; fix NULL dereference in test Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/api/declarative_content.json
diff --git a/chrome/common/extensions/api/declarative_content.json b/chrome/common/extensions/api/declarative_content.json
new file mode 100644
index 0000000000000000000000000000000000000000..13696f1f175de3b17bdddf49372ef15f2fca7edb
--- /dev/null
+++ b/chrome/common/extensions/api/declarative_content.json
@@ -0,0 +1,73 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+[
+ {
+ "namespace": "declarativeContent",
+ "documentation_permissions_required": ["declarative", "declarativeContent"],
+ "types": [
+ {
+ "id": "PageStateMatcher",
+ "type": "object",
+ "description": "Matches the state of a web page by various criteria.",
+ "properties": {
+ "pageUrl": {
+ "$ref": "events.UrlFilter",
+ "description": "Matches if the condition of the UrlFilter are fulfilled for the top-level URL of the page.",
+ "optional": true
+ },
+ "css": {
+ "type": "array",
+ "optional": true,
+ "description": "Matches if all of the CSS selectors in the array match in a frame with the same origin as the page's main frame. Note that listing hundreds of CSS selectors here can slow down web sites.",
+ // TODO(jyasskin): Figure out if we want to require all
+ // the selectors to match in the same frame, or allow several
+ // frames to contribute to a match.
+ "items": { "type": "string" }
+ // TODO(jyasskin): Validate that the selectors in this
+ // array are valid. Otherwise, we can get exceptions from
+ // content_watcher.js:FindMatchingSelectors() long after the
+ // rule is registered.
+// },
+// TODO: "text": {
+// "type": "array",
+// "optional": true,
+// "description": "Matches if all of the regular expressions in the array match text in the page. The regular expressions use the <a href=\"http://code.google.com/p/re2/wiki/Syntax\">RE2 syntax</a>.",
+// "items": { "type": "string" }
+ },
+ "instanceType": {
+ "type": "string", "enum": ["declarativeContent.PageStateMatcher"],
+ "nodoc": true
+ }
+ }
+ },
+ {
+ "id": "ShowPageAction",
+ "description": "Declarative event action that shows the extension's page action while the corresponding conditions are met.",
+ "type": "object",
+ "properties": {
+ "instanceType": {
+ "type": "string", "enum": ["declarativeContent.ShowPageAction"],
+ "nodoc": true
+ }
+ }
+ }
+ ],
+ "functions": [
+ ],
+ "events": [
+ {
+ "name": "onPageChanged",
+ "options": {
+ "supportsListeners": false,
+ "supportsRules": true,
+ "conditions": ["declarativeContent.PageStateMatcher"],
+ "actions": [
+ "declarativeContent.ShowPageAction"
+ ]
+ }
+ }
+ ]
+ }
+]

Powered by Google App Engine
This is Rietveld 408576698