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

Side by Side Diff: extensions/common/api/web_view_internal.json

Issue 959413003: Implement <webview>.addContentScript/removeContentScript API [1] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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": "webViewInternal", 7 "namespace": "webViewInternal",
8 "description": "none", 8 "description": "none",
9 "compiler_options": { 9 "compiler_options": {
10 "implemented_in": "extensions/browser/api/guest_view/web_view/web_view_int ernal_api.h" 10 "implemented_in": "extensions/browser/api/guest_view/web_view/web_view_int ernal_api.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 { 86 {
87 "id": "StopFindingAction", 87 "id": "StopFindingAction",
88 "type": "string", 88 "type": "string",
89 "description": "Determines what to do with the active match after the fi nd session has ended. 'clear' will clear the highlighting over the active match; 'keep' will keep the active match highlighted; 'activate' will keep the active match highlighted and simulate a user click on that match.", 89 "description": "Determines what to do with the active match after the fi nd session has ended. 'clear' will clear the highlighting over the active match; 'keep' will keep the active match highlighted; 'activate' will keep the active match highlighted and simulate a user click on that match.",
90 "enum": ["clear", "keep", "activate"] 90 "enum": ["clear", "keep", "activate"]
91 }, 91 },
92 { 92 {
93 "id": "SetPermissionAction", 93 "id": "SetPermissionAction",
94 "type": "string", 94 "type": "string",
95 "enum": ["allow", "deny", "default"] 95 "enum": ["allow", "deny", "default"]
96 },
97 {
98 "id": "RunLocation",
99 "type": "string",
100 "enum": ["document_start", "document_end", "document_idle"]
101 },
102 {
103 "id": "ContentScriptDetails",
104 "type": "object",
105 "description": "Details of the content script to inject.",
106 "properties": {
107 "name": {
108 "type": "string",
109 "description": "The name of the content script to inject."
110 },
111 "matches": {
112 "type": "array",
113 "items": { "type": "string"},
114 "description": "Specifies which pages this content script will be in jected into."
115 },
116 "exclude_matches": {
117 "type": "array",
118 "items": { "type": "string"},
119 "optional": true,
120 "description": "Excludes pages that this content script would otherw ise be injected into."
121 },
122 "match_about_blank": {
123 "type": "boolean",
124 "optional": true,
125 "description": "Whether to insert the content script on about:blank and about:srcdoc. Content scripts will only be injected on pages when their inhe rit URL is matched by one of the declared patterns in the matches field. The inh erit URL is the URL of the document that created the frame or window. Content sc ripts cannot be inserted in sandboxed frames."
126 },
127 "css": {
128 "type": "array",
129 "items": { "type": "string"},
130 "optional": true,
131 "description": "The list of CSS files to be injected into matching p ages. These are injected in the order they appear in this array, before any DOM is constructed or displayed for the page."
132 },
133 "js": {
134 "type": "array",
135 "items": { "type": "string"},
136 "optional": true,
137 "description": "The list of JavaScript files to be injected into mat ching pages. These are injected in the order they appear in this array."
138 },
139 "run_at": {
140 // TODO(hanxi): change the reference to extensionTypes.RunAt after h ttp://crbug.com/477457 is fixed.
141 "$ref": "RunLocation",
142 "optional": true,
143 "description": "The soonest that the JavaScript or CSS will be injec ted into the tab. Defaults to \"document_idle\"."
144 },
145 "all_frames": {
146 "type": "boolean",
147 "optional": true,
148 "description": "If allFrames is <code>true</code>, implies that the JavaScript or CSS should be injected into all frames of current page. By default , it's <code>false</code> and is only injected into the top frame."
149 },
150 "include_globs": {
151 "type": "array",
152 "items": { "type": "string"},
153 "optional": true,
154 "description": "Applied after matches to include only those URLs tha t also match this glob. Intended to emulate the @include Greasemonkey keyword."
155 },
156 "exclude_globs": {
157 "type": "array",
158 "items": { "type": "string"},
159 "optional": true,
160 "description": "Applied after matches to exclude URLs that match thi s glob. Intended to emulate the @exclude Greasemonkey keyword."
161 }
162 },
163 "required": ["name", "matches"]
96 } 164 }
97 ], 165 ],
98 "functions": [ 166 "functions": [
99 { 167 {
100 "name": "executeScript", 168 "name": "executeScript",
101 "type": "function", 169 "type": "function",
102 "description": "Injects JavaScript code into a <webview> page.", 170 "description": "Injects JavaScript code into a <webview> page.",
103 "parameters": [ 171 "parameters": [
104 { 172 {
105 "type": "integer", 173 "type": "integer",
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 { 224 {
157 "type": "function", 225 "type": "function",
158 "name": "callback", 226 "name": "callback",
159 "optional": true, 227 "optional": true,
160 "description": "Called when all the CSS has been inserted.", 228 "description": "Called when all the CSS has been inserted.",
161 "parameters": [] 229 "parameters": []
162 } 230 }
163 ] 231 ]
164 }, 232 },
165 { 233 {
234 "name": "addContentScripts",
235 "type": "function",
236 "description": "Adds content scripts into a <webview> page. For details, see the <a href='/extensions/content_scripts#pi'>programmatic injection</a> sec tion of the content scripts doc.",
237 "parameters": [
238 {
239 "type": "integer",
240 "name": "instanceId",
241 "description": "The instance ID of the guest <webview> process."
242 },
243 {
244 "type": "array",
245 "name": "contentScriptList",
246 "items": {
247 "$ref": "ContentScriptDetails",
248 "name": "contentScriptDetails",
249 "minimum": 1
250 },
251 "description": "Details of the content scripts to add."
252 },
253 {
254 "type": "function",
255 "name": "callback",
256 "optional": true,
257 "description": "Called when all the content scripts has been added." ,
258 "parameters": []
259 }
260 ]
261 },
262 {
263 "name": "removeContentScripts",
264 "type": "function",
265 "description": "Removes specified content scripts from a <webview> page. For details, see the <a href='/extensions/content_scripts#pi'>programmatic inje ction</a> section of the content scripts doc.",
266 "parameters": [
267 {
268 "type": "integer",
269 "name": "instanceId",
270 "description": "The instance ID of the guest <webview> process."
271 },
272 {
273 "type": "array",
274 "name": "scriptNameList",
275 "items": {
276 "type": "string",
277 "minimum": 0,
278 "description": "The name of a content script that will be removed. "
279 },
280 "optional": true,
281 "description": "A list of names of content scripts that will be remo ved. If the list is empty, all the content scripts added to the <webview> page w ill be removed."
282 },
283 {
284 "type": "function",
285 "name": "callback",
286 "optional": true,
287 "description": "Called when all the content scripts has been removed .",
288 "parameters": []
289 }
290 ]
291 },
292 {
166 "name": "setZoom", 293 "name": "setZoom",
167 "type": "function", 294 "type": "function",
168 "parameters": [ 295 "parameters": [
169 { 296 {
170 "type": "integer", 297 "type": "integer",
171 "name": "instanceId", 298 "name": "instanceId",
172 "description": "The instance ID of the guest <webview> process." 299 "description": "The instance ID of the guest <webview> process."
173 }, 300 },
174 { 301 {
175 "type": "number", 302 "type": "number",
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 "type": "function", 698 "type": "function",
572 "description": "Called when deletion has completed.", 699 "description": "Called when deletion has completed.",
573 "optional": true, 700 "optional": true,
574 "parameters": [] 701 "parameters": []
575 } 702 }
576 ] 703 ]
577 } 704 }
578 ] 705 ]
579 } 706 }
580 ] 707 ]
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698