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

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

Issue 344433003: Prepare declarativeContent API for new script injection feature. Added Javascript types and functio… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address first round review comments and fix test build failure Created 6 years, 6 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
index 7c383b58e2488cde704d5bc0a362beb348feebd4..07b4b42855863112b62b13ede4c9b411257c7449 100644
--- a/chrome/common/extensions/api/declarative_content.json
+++ b/chrome/common/extensions/api/declarative_content.json
@@ -48,6 +48,52 @@
"nodoc": true
}
}
+ },
+ {
+ "id": "ContentScript",
+ "description": "Declarative content script definition.",
+ "type": "object",
+ "properties": {
+ "css": {
+ "type": "array",
+ "optional": true,
+ "description": "Names of CSS files to be injected as a part of content script.",
+ "items": { "type": "string" }
+ },
+ "js": {
+ "type": "array",
+ "optional": true,
+ "description": "Names of Javascript files to be injected as a part of content script.",
+ "items": { "type": "string" }
+ },
+ "callback": {
not at google - send to devlin 2014/06/24 15:06:43 We weren't going to have a callback, right?
Mark Dittmer 2014/06/25 14:36:05 Done.
+ "type": "function",
+ "optional": true,
+ "description": "Function to be called after content script injection attempt is complete."
+ },
+ "instanceType": {
+ "type": "string", "enum": ["declarativeContent.ContentScript"],
+ "nodoc": true
+ }
+ }
+ },
+ {
+ "id": "RequestContentScript",
not at google - send to devlin 2014/06/24 15:06:43 I don't think we need 2 different types here. If i
Mark Dittmer 2014/06/25 14:36:05 Done.
+ "description": "Declarative event action that injects a content script.",
+ "type": "object",
+ "properties": {
+ "script": {
+ "$ref": "ContentScript"
+ },
+ "callback": {
+ "type": "function",
+ "optional": true
+ },
+ "instanceType": {
+ "type": "string", "enum": ["declarativeContent.RequestContentScript"],
+ "nodoc": true
+ }
+ }
}
],
"functions": [
@@ -63,6 +109,39 @@
"declarativeContent.ShowPageAction"
]
}
+ },
+ {
+ "name": "onDocumentStart",
+ "options": {
+ "supportsListeners": false,
+ "supportsRules": true,
+ "conditions": ["declarativeContent.PageStateMatcher"],
+ "actions": [
+ "declarativeContent.RequestContentScript"
+ ]
+ }
+ },
+ {
+ "name": "onDocumentEnd",
+ "options": {
+ "supportsListeners": false,
+ "supportsRules": true,
+ "conditions": ["declarativeContent.PageStateMatcher"],
+ "actions": [
+ "declarativeContent.RequestContentScript"
+ ]
+ }
+ },
+ {
+ "name": "onDocumentIdle",
+ "options": {
+ "supportsListeners": false,
+ "supportsRules": true,
+ "conditions": ["declarativeContent.PageStateMatcher"],
+ "actions": [
+ "declarativeContent.RequestContentScript"
+ ]
+ }
}
]
}
« no previous file with comments | « chrome/browser/extensions/tab_helper.cc ('k') | chrome/renderer/resources/extensions/declarative_content_custom_bindings.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698