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
3 // found in the LICENSE file.
7 "namespace": "declarativeContent",
8 "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.",
11 "id": "PageStateMatcher",
13 "description": "Matches the state of a web page by various criteria.",
16 "$ref": "events.UrlFilter",
17 "description": "Matches if the condition of the UrlFilter are fulfilled for the top-level URL of the page.",
23 "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.",
24 // TODO(jyasskin): Figure out if we want to require all
25 // the selectors to match in the same frame, or allow several
26 // frames to contribute to a match.
27 "items": { "type": "string" }
32 // "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>.",
33 // "items": { "type": "string" }
36 "type": "string", "enum": ["declarativeContent.PageStateMatcher"],
42 "id": "ShowPageAction",
43 "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.html#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.",
47 "type": "string", "enum": ["declarativeContent.ShowPageAction"],
57 "name": "onPageChanged",
59 "supportsListeners": false,
60 "supportsRules": true,
61 "conditions": ["declarativeContent.PageStateMatcher"],
63 "declarativeContent.ShowPageAction"