OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 [ |
| 6 { |
| 7 "namespace": "declarativeContent", |
| 8 "documentation_permissions_required": ["declarative", "declarativeContent"], |
| 9 "types": [ |
| 10 { |
| 11 "id": "PageStateMatcher", |
| 12 "type": "object", |
| 13 "description": "Matches the state of a web page by various criteria.", |
| 14 "properties": { |
| 15 "pageUrl": { |
| 16 "$ref": "events.UrlFilter", |
| 17 "description": "Matches if the condition of the UrlFilter are fulfil
led for the top-level URL of the page.", |
| 18 "optional": true |
| 19 }, |
| 20 "css": { |
| 21 "type": "array", |
| 22 "optional": true, |
| 23 "description": "Matches if all of the CSS selectors in the array mat
ch 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.", |
| 24 // TODO(jyasskin): Figure out if we want to require all |
| 25 // the selectors to match in the same frame, or allow several |
| 26 // frames to contribute to a match. |
| 27 "items": { "type": "string" } |
| 28 // TODO(jyasskin): Validate that the selectors in this |
| 29 // array are valid. Otherwise, we can get exceptions from |
| 30 // content_watcher.js:FindMatchingSelectors() long after the |
| 31 // rule is registered. |
| 32 // }, |
| 33 // TODO: "text": { |
| 34 // "type": "array", |
| 35 // "optional": true, |
| 36 // "description": "Matches if all of the regular expressions in the a
rray match text in the page. The regular expressions use the <a href=\"http://co
de.google.com/p/re2/wiki/Syntax\">RE2 syntax</a>.", |
| 37 // "items": { "type": "string" } |
| 38 }, |
| 39 "instanceType": { |
| 40 "type": "string", "enum": ["declarativeContent.PageStateMatcher"], |
| 41 "nodoc": true |
| 42 } |
| 43 } |
| 44 }, |
| 45 { |
| 46 "id": "ShowPageAction", |
| 47 "description": "Declarative event action that shows the extension's page
action while the corresponding conditions are met.", |
| 48 "type": "object", |
| 49 "properties": { |
| 50 "instanceType": { |
| 51 "type": "string", "enum": ["declarativeContent.ShowPageAction"], |
| 52 "nodoc": true |
| 53 } |
| 54 } |
| 55 } |
| 56 ], |
| 57 "functions": [ |
| 58 ], |
| 59 "events": [ |
| 60 { |
| 61 "name": "onPageChanged", |
| 62 "options": { |
| 63 "supportsListeners": false, |
| 64 "supportsRules": true, |
| 65 "conditions": ["declarativeContent.PageStateMatcher"], |
| 66 "actions": [ |
| 67 "declarativeContent.ShowPageAction" |
| 68 ] |
| 69 } |
| 70 } |
| 71 ] |
| 72 } |
| 73 ] |
OLD | NEW |