| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 [ | 5 [ |
| 6 { | 6 { |
| 7 "namespace": "declarativeContent", | 7 "namespace": "declarativeContent", |
| 8 "description": "Use the <code>chrome.declarativeContent</code> API to take a
ctions depending on the content of a page, without requiring permission to read
the page's content.", | 8 "description": "Use the <code>chrome.declarativeContent</code> API to take a
ctions depending on the content of a page, without requiring permission to read
the page's content.", |
| 9 "types": [ | 9 "types": [ |
| 10 { | 10 { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 { | 41 { |
| 42 "id": "ShowPageAction", | 42 "id": "ShowPageAction", |
| 43 "description": "Declarative event action that shows the extension's $(re
f:pageAction page action) while the corresponding conditions are met. This acti
on can be used without <a href=\"declare_permissions#host-permissions\">host per
missions</a>, but the extension must have a page action. If the extension takes
the <a href=\"activeTab.html\">activeTab</a> permission, a click on the page ac
tion will grant access to the active tab.", | 43 "description": "Declarative event action that shows the extension's $(re
f:pageAction page action) while the corresponding conditions are met. This acti
on can be used without <a href=\"declare_permissions#host-permissions\">host per
missions</a>, but the extension must have a page action. If the extension takes
the <a href=\"activeTab.html\">activeTab</a> permission, a click on the page ac
tion will grant access to the active tab.", |
| 44 "type": "object", | 44 "type": "object", |
| 45 "properties": { | 45 "properties": { |
| 46 "instanceType": { | 46 "instanceType": { |
| 47 "type": "string", "enum": ["declarativeContent.ShowPageAction"], | 47 "type": "string", "enum": ["declarativeContent.ShowPageAction"], |
| 48 "nodoc": true | 48 "nodoc": true |
| 49 } | 49 } |
| 50 } | 50 } |
| 51 }, |
| 52 { |
| 53 "id": "ContentScript", |
| 54 "description": "Declarative content script definition.", |
| 55 "type": "object", |
| 56 "properties": { |
| 57 "css": { |
| 58 "type": "array", |
| 59 "optional": true, |
| 60 "description": "Names of CSS files to be injected as a part of conte
nt script.", |
| 61 "items": { "type": "string" } |
| 62 }, |
| 63 "js": { |
| 64 "type": "array", |
| 65 "optional": true, |
| 66 "description": "Names of Javascript files to be injected as a part o
f content script.", |
| 67 "items": { "type": "string" } |
| 68 }, |
| 69 "callback": { |
| 70 "type": "function", |
| 71 "optional": true, |
| 72 "description": "Function to be called after content script injection
attempt is complete." |
| 73 }, |
| 74 "instanceType": { |
| 75 "type": "string", "enum": ["declarativeContent.ContentScript"], |
| 76 "nodoc": true |
| 77 } |
| 78 } |
| 79 }, |
| 80 { |
| 81 "id": "RequestContentScript", |
| 82 "description": "Declarative event action that injects a content script."
, |
| 83 "type": "object", |
| 84 "properties": { |
| 85 "script": { |
| 86 "$ref": "ContentScript" |
| 87 }, |
| 88 "callback": { |
| 89 "type": "function", |
| 90 "optional": true |
| 91 }, |
| 92 "instanceType": { |
| 93 "type": "string", "enum": ["declarativeContent.RequestContentScript"
], |
| 94 "nodoc": true |
| 95 } |
| 96 } |
| 51 } | 97 } |
| 52 ], | 98 ], |
| 53 "functions": [ | 99 "functions": [ |
| 54 ], | 100 ], |
| 55 "events": [ | 101 "events": [ |
| 56 { | 102 { |
| 57 "name": "onPageChanged", | 103 "name": "onPageChanged", |
| 58 "options": { | 104 "options": { |
| 59 "supportsListeners": false, | 105 "supportsListeners": false, |
| 60 "supportsRules": true, | 106 "supportsRules": true, |
| 61 "conditions": ["declarativeContent.PageStateMatcher"], | 107 "conditions": ["declarativeContent.PageStateMatcher"], |
| 62 "actions": [ | 108 "actions": [ |
| 63 "declarativeContent.ShowPageAction" | 109 "declarativeContent.ShowPageAction" |
| 64 ] | 110 ] |
| 65 } | 111 } |
| 112 }, |
| 113 { |
| 114 "name": "onDocumentStart", |
| 115 "options": { |
| 116 "supportsListeners": false, |
| 117 "supportsRules": true, |
| 118 "conditions": ["declarativeContent.PageStateMatcher"], |
| 119 "actions": [ |
| 120 "declarativeContent.RequestContentScript" |
| 121 ] |
| 122 } |
| 123 }, |
| 124 { |
| 125 "name": "onDocumentEnd", |
| 126 "options": { |
| 127 "supportsListeners": false, |
| 128 "supportsRules": true, |
| 129 "conditions": ["declarativeContent.PageStateMatcher"], |
| 130 "actions": [ |
| 131 "declarativeContent.RequestContentScript" |
| 132 ] |
| 133 } |
| 134 }, |
| 135 { |
| 136 "name": "onDocumentIdle", |
| 137 "options": { |
| 138 "supportsListeners": false, |
| 139 "supportsRules": true, |
| 140 "conditions": ["declarativeContent.PageStateMatcher"], |
| 141 "actions": [ |
| 142 "declarativeContent.RequestContentScript" |
| 143 ] |
| 144 } |
| 66 } | 145 } |
| 67 ] | 146 ] |
| 68 } | 147 } |
| 69 ] | 148 ] |
| OLD | NEW |