// Copyright (c) 2012 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": "declarativeContent", "description": "Use the <code>chrome.declarativeContent</code> API to take actions depending on the content of a page, without requiring permission to read the page's content.", "types": [ { "id": "PageStateMatcher", "type": "object", "description": "Matches the state of a web page by various criteria.", "properties": { "pageUrl": { "$ref": "events.UrlFilter", "description": "Matches if the condition of the UrlFilter are fulfilled for the top-level URL of the page.", "optional": true }, "css": { "type": "array", "optional": true, "description": "Matches if all of the CSS selectors in the array match displayed elements in a frame with the same origin as the page's main frame. All selectors in this array must be <a href=\"http://www.w3.org/TR/selectors4/#compound\">compound selectors</a> to speed up matching. Note that listing hundreds of CSS selectors or CSS selectors that match hundreds of times per page can still slow down web sites.", // TODO(jyasskin): Figure out if we want to require all // the selectors to match in the same frame, or allow several // frames to contribute to a match. "items": { "type": "string" } // }, // TODO: "text": { // "type": "array", // "optional": true, // "description": "Matches if all of the regular expressions in the array match text in the page. The regular expressions use the <a href=\"http://code.google.com/p/re2/wiki/Syntax\">RE2 syntax</a>.", // "items": { "type": "string" } }, "instanceType": { "type": "string", "enum": ["declarativeContent.PageStateMatcher"], "nodoc": true } } }, { "id": "ShowPageAction", "description": "Declarative event action that shows the extension's $(ref:pageAction page action) while the corresponding conditions are met. This action can be used without <a href=\"declare_permissions#host-permissions\">host permissions</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 action will grant access to the active tab.", "type": "object", "properties": { "instanceType": { "type": "string", "enum": ["declarativeContent.ShowPageAction"], "nodoc": true } } } ], "functions": [ ], "events": [ { "name": "onPageChanged", "options": { "supportsListeners": false, "supportsRules": true, "conditions": ["declarativeContent.PageStateMatcher"], "actions": [ "declarativeContent.ShowPageAction" ] } } ] } ]