OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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": "tabs", | 7 "namespace": "tabs", |
8 "description": "Use the <code>chrome.tabs</code> API to interact with the br
owser's tab system. You can use this API to create, modify, and rearrange tabs i
n the browser.", | 8 "description": "Use the <code>chrome.tabs</code> API to interact with the br
owser's tab system. You can use this API to create, modify, and rearrange tabs i
n the browser.", |
9 "types": [ | 9 "types": [ |
10 { | 10 { |
(...skipping 13 matching lines...) Expand all Loading... |
24 "title": {"type": "string", "optional": true, "optional": true, "descr
iption": "The title of the tab. This property is only present if the extension's
manifest includes the <code>\"tabs\"</code> permission."}, | 24 "title": {"type": "string", "optional": true, "optional": true, "descr
iption": "The title of the tab. This property is only present if the extension's
manifest includes the <code>\"tabs\"</code> permission."}, |
25 "favIconUrl": {"type": "string", "optional": true, "optional": true, "
description": "The URL of the tab's favicon. This property is only present if th
e extension's manifest includes the <code>\"tabs\"</code> permission. It may als
o be an empty string if the tab is loading."}, | 25 "favIconUrl": {"type": "string", "optional": true, "optional": true, "
description": "The URL of the tab's favicon. This property is only present if th
e extension's manifest includes the <code>\"tabs\"</code> permission. It may als
o be an empty string if the tab is loading."}, |
26 "status": {"type": "string", "optional": true, "description": "Either
<em>loading</em> or <em>complete</em>."}, | 26 "status": {"type": "string", "optional": true, "description": "Either
<em>loading</em> or <em>complete</em>."}, |
27 "incognito": {"type": "boolean", "description": "Whether the tab is in
an incognito window."}, | 27 "incognito": {"type": "boolean", "description": "Whether the tab is in
an incognito window."}, |
28 "width": {"type": "integer", "optional": true, "description": "The wid
th of the tab in pixels."}, | 28 "width": {"type": "integer", "optional": true, "description": "The wid
th of the tab in pixels."}, |
29 "height": {"type": "integer", "optional": true, "description": "The he
ight of the tab in pixels."}, | 29 "height": {"type": "integer", "optional": true, "description": "The he
ight of the tab in pixels."}, |
30 "sessionId": {"type": "string", "optional": true, "description": "The
session ID used to uniquely identify a Tab obtained from the $(ref:sessions) API
."} | 30 "sessionId": {"type": "string", "optional": true, "description": "The
session ID used to uniquely identify a Tab obtained from the $(ref:sessions) API
."} |
31 } | 31 } |
32 }, | 32 }, |
33 { | 33 { |
34 "id": "InjectDetails", | |
35 "type": "object", | |
36 "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.", | |
37 "properties": { | |
38 "code": {"type": "string", "optional": true, "description": "JavaScrip
t or CSS code to inject.<br><br><b>Warning:</b><br>Be careful using the <code>co
de</code> parameter. Incorrect use of it may open your extension to <a href=\"ht
tps://en.wikipedia.org/wiki/Cross-site_scripting\">cross site scripting</a> atta
cks."}, | |
39 "file": {"type": "string", "optional": true, "description": "JavaScrip
t or CSS file to inject."}, | |
40 "allFrames": {"type": "boolean", "optional": true, "description": "If
allFrames is <code>true</code>, implies that the JavaScript or CSS should be inj
ected into all frames of current page. By default, it's <code>false</code> and i
s only injected into the top frame."}, | |
41 "matchAboutBlank": {"type": "boolean", "optional": true, "description"
: "If matchAboutBlank is true, then the code is also injected in about:blank and
about:srcdoc frames if your extension has access to its parent document. Code c
annot be inserted in top-level about:-frames. By default it is <code>false</code
>."}, | |
42 "runAt": { | |
43 "type": "string", | |
44 "optional": true, | |
45 "enum": ["document_start", "document_end", "document_idle"], | |
46 "description": "The soonest that the JavaScript or CSS will be injec
ted into the tab. Defaults to \"document_idle\"." | |
47 } | |
48 } | |
49 }, | |
50 { | |
51 "id": "ZoomSettings", | 34 "id": "ZoomSettings", |
52 "type": "object", | 35 "type": "object", |
53 "description": "Defines how zoom changes in a tab are handled and at wha
t scope.", | 36 "description": "Defines how zoom changes in a tab are handled and at wha
t scope.", |
54 "properties": { | 37 "properties": { |
55 "mode": { | 38 "mode": { |
56 "type": "string", | 39 "type": "string", |
57 "description": "Defines how zoom changes are handled, i.e. which ent
ity is responsible for the actual scaling of the page; defaults to <code>automat
ic</code>.", | 40 "description": "Defines how zoom changes are handled, i.e. which ent
ity is responsible for the actual scaling of the page; defaults to <code>automat
ic</code>.", |
58 "optional": true, | 41 "optional": true, |
59 "enum": [ | 42 "enum": [ |
60 { | 43 { |
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
665 } | 648 } |
666 ] | 649 ] |
667 }, | 650 }, |
668 { | 651 { |
669 "name": "executeScript", | 652 "name": "executeScript", |
670 "type": "function", | 653 "type": "function", |
671 "description": "Injects JavaScript code into a page. For details, see th
e <a href='content_scripts#pi'>programmatic injection</a> section of the content
scripts doc.", | 654 "description": "Injects JavaScript code into a page. For details, see th
e <a href='content_scripts#pi'>programmatic injection</a> section of the content
scripts doc.", |
672 "parameters": [ | 655 "parameters": [ |
673 {"type": "integer", "name": "tabId", "minimum": 0, "optional": true, "
description": "The ID of the tab in which to run the script; defaults to the act
ive tab of the current window."}, | 656 {"type": "integer", "name": "tabId", "minimum": 0, "optional": true, "
description": "The ID of the tab in which to run the script; defaults to the act
ive tab of the current window."}, |
674 { | 657 { |
675 "$ref": "tabs.InjectDetails", | 658 "$ref": "extensionTypes.InjectDetails", |
676 "name": "details", | 659 "name": "details", |
677 "description": "Details of the script to run." | 660 "description": "Details of the script to run." |
678 }, | 661 }, |
679 { | 662 { |
680 "type": "function", | 663 "type": "function", |
681 "name": "callback", | 664 "name": "callback", |
682 "optional": true, | 665 "optional": true, |
683 "description": "Called after all the JavaScript has been executed.", | 666 "description": "Called after all the JavaScript has been executed.", |
684 "parameters": [ | 667 "parameters": [ |
685 { | 668 { |
686 "name": "result", | 669 "name": "result", |
687 "optional": true, | 670 "optional": true, |
688 "type": "array", | 671 "type": "array", |
689 "items": {"type": "any", "minimum": 0}, | 672 "items": {"type": "any", "minimum": 0}, |
690 "description": "The result of the script in every injected frame
." | 673 "description": "The result of the script in every injected frame
." |
691 } | 674 } |
692 ] | 675 ] |
693 } | 676 } |
694 ] | 677 ] |
695 }, | 678 }, |
696 { | 679 { |
697 "name": "insertCSS", | 680 "name": "insertCSS", |
698 "type": "function", | 681 "type": "function", |
699 "description": "Injects CSS into a page. For details, see the <a href='c
ontent_scripts#pi'>programmatic injection</a> section of the content scripts doc
.", | 682 "description": "Injects CSS into a page. For details, see the <a href='c
ontent_scripts#pi'>programmatic injection</a> section of the content scripts doc
.", |
700 "parameters": [ | 683 "parameters": [ |
701 {"type": "integer", "name": "tabId", "minimum": 0, "optional": true, "
description": "The ID of the tab in which to insert the CSS; defaults to the act
ive tab of the current window."}, | 684 {"type": "integer", "name": "tabId", "minimum": 0, "optional": true, "
description": "The ID of the tab in which to insert the CSS; defaults to the act
ive tab of the current window."}, |
702 { | 685 { |
703 "$ref": "tabs.InjectDetails", | 686 "$ref": "extensionTypes.InjectDetails", |
704 "name": "details", | 687 "name": "details", |
705 "description": "Details of the CSS text to insert." | 688 "description": "Details of the CSS text to insert." |
706 }, | 689 }, |
707 { | 690 { |
708 "type": "function", | 691 "type": "function", |
709 "name": "callback", | 692 "name": "callback", |
710 "optional": true, | 693 "optional": true, |
711 "description": "Called when all the CSS has been inserted.", | 694 "description": "Called when all the CSS has been inserted.", |
712 "parameters": [] | 695 "parameters": [] |
713 } | 696 } |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1077 "tabId": {"type": "integer", "minimum": 0}, | 1060 "tabId": {"type": "integer", "minimum": 0}, |
1078 "oldZoomFactor": {"type": "number"}, | 1061 "oldZoomFactor": {"type": "number"}, |
1079 "newZoomFactor": {"type": "number"}, | 1062 "newZoomFactor": {"type": "number"}, |
1080 "zoomSettings": {"$ref": "ZoomSettings"} | 1063 "zoomSettings": {"$ref": "ZoomSettings"} |
1081 } | 1064 } |
1082 }] | 1065 }] |
1083 } | 1066 } |
1084 ] | 1067 ] |
1085 } | 1068 } |
1086 ] | 1069 ] |
OLD | NEW |