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

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

Issue 11968054: <webview>: Implement ExecuteScript (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updated stale browser_plugin_messages.h 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/webview.json
diff --git a/chrome/common/extensions/api/webview.json b/chrome/common/extensions/api/webview.json
new file mode 100644
index 0000000000000000000000000000000000000000..79e7fcd13bbb440211881ca8ace3c1e4cad2f4c6
--- /dev/null
+++ b/chrome/common/extensions/api/webview.json
@@ -0,0 +1,71 @@
+// Copyright (c) 2013 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": "webview",
Matt Perry 2013/01/23 20:23:58 add "nodoc": true here. Otherwise we'll generate e
Fady Samuel 2013/01/23 20:54:32 Done. Yes, <webview> is documented elsewhere.
+ "dependencies": [ "extension", "tabs" ],
+ "types": [
+ // TODO(fsamuel): We should be usng tabs.InjectDetails. However, due to a
+ // bug in the JSON compiler, we are currently copying-and-pasting this
+ // type: https://crbug.com/171726.
+ {
+ "id": "InjectDetails",
+ "type": "object",
+ "description": "Details of the script or CSS to inject. Either the code or the file property must be set, but both may not be set at the same time.",
+ "properties": {
+ "code": {"type": "string", "optional": true, "description": "JavaScript or CSS code to inject."},
+ "file": {"type": "string", "optional": true, "description": "JavaScript or CSS file to inject."},
+ "allFrames": {"type": "boolean", "optional": true, "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 will only be injected into the top frame."},
+ "runAt": {
+ "type": "string",
+ "optional": true,
+ "enum": ["document_start", "document_end", "document_idle"],
+ "description": "The soonest that the JavaScript or CSS will be injected into the tab. Defaults to \"document_idle\"."
+ }
+ }
+ }
+ ],
+ "functions": [
+ {
+ "name": "executeScript",
+ "type": "function",
+ "description": "Injects JavaScript code into a <webview> page.",
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "processId",
+ "description": "The process ID of the guest <webview> process."
+ },
+ {
+ "type": "integer",
+ "name": "routeId",
+ "description": "The route ID of the guest <webview> renderer."
+ },
+ {
+ "$ref": "webview.InjectDetails",
+ "name": "details",
+ "description": "Details of the script to run."
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "description": "Called after all the JavaScript has been executed.",
+ "parameters": [
+ {
+ "name": "result",
+ "optional": true,
+ "type": "array",
+ "items": {"type": "any", "minimum": 0},
+ "description": "The result of the script in every injected frame."
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+]
+

Powered by Google App Engine
This is Rietveld 408576698