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 28 matching lines...) Expand all Loading... |
39 "file": {"type": "string", "optional": true, "description": "JavaScrip
t or CSS file to inject."}, | 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."}, | 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
>."}, | 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": { | 42 "runAt": { |
43 "type": "string", | 43 "type": "string", |
44 "optional": true, | 44 "optional": true, |
45 "enum": ["document_start", "document_end", "document_idle"], | 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\"." | 46 "description": "The soonest that the JavaScript or CSS will be injec
ted into the tab. Defaults to \"document_idle\"." |
47 } | 47 } |
48 } | 48 } |
| 49 }, |
| 50 { |
| 51 "id": "ZoomSettings", |
| 52 "type": "object", |
| 53 "description": "Defines how zoom changes in a tab are handled and at wha
t scope.", |
| 54 "properties": { |
| 55 "mode": { |
| 56 "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>.", |
| 58 "optional": true, |
| 59 "enum": [ |
| 60 { |
| 61 "name": "automatic", |
| 62 "description": "Zoom changes are handled automatically by the br
owser." |
| 63 }, |
| 64 { |
| 65 "name": "manual", |
| 66 "description": "Overrides the automatic handling of zoom changes
. The <code>onZoomChange</code> event will still be dispatched, and it is the re
sponsibility of the extension to listen for this event and manually scale the pa
ge. This mode does not support <code>per-origin</code> zooming, and will thus ig
nore the <code>scope</code> zoom setting and assume <code>per-tab</code>." |
| 67 }, |
| 68 { |
| 69 "name": "disabled", |
| 70 "description": "Disables all zooming in the tab. The tab will re
vert to default (100%) zoom, and all attempted zoom changes will be ignored." |
| 71 } |
| 72 ] |
| 73 }, |
| 74 "scope": { |
| 75 "type": "string", |
| 76 "description": "Defines whether zoom changes will persist for the pa
ge's origin, or only take effect in this tab; defaults to <code>per-origin</code
> when in <code>automatic</code> mode, and <code>per-tab</code> otherwise.", |
| 77 "optional": true, |
| 78 "enum": [ |
| 79 { |
| 80 "name": "per-origin", |
| 81 "description": "Zoom changes will persist in the zoomed page's o
rigin, i.e. all other tabs navigated to that same origin will be zoomed as well.
Moreover, <code>per-origin</code> zoom changes are saved with the origin, meani
ng that when navigating to other pages in the same origin, they will all be zoom
ed to the same zoom factor. The <code>per-origin</code> scope is only available
in the <code>automatic</code> mode." |
| 82 }, |
| 83 { |
| 84 "name": "per-tab", |
| 85 "description": "Zoom changes only take effect in this tab, and z
oom changes in other tabs will not affect the zooming of this tab. Also, <code>p
er-tab</code> zoom changes are reset on navigation; navigating a tab will always
load pages with their <code>per-origin</code> zoom factors." |
| 86 } |
| 87 ] |
| 88 } |
| 89 } |
49 } | 90 } |
50 ], | 91 ], |
51 "functions": [ | 92 "functions": [ |
52 { | 93 { |
53 "name": "get", | 94 "name": "get", |
54 "type": "function", | 95 "type": "function", |
55 "description": "Retrieves details about the specified tab.", | 96 "description": "Retrieves details about the specified tab.", |
56 "parameters": [ | 97 "parameters": [ |
57 { | 98 { |
58 "type": "integer", | 99 "type": "integer", |
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
664 "description": "Details of the CSS text to insert." | 705 "description": "Details of the CSS text to insert." |
665 }, | 706 }, |
666 { | 707 { |
667 "type": "function", | 708 "type": "function", |
668 "name": "callback", | 709 "name": "callback", |
669 "optional": true, | 710 "optional": true, |
670 "description": "Called when all the CSS has been inserted.", | 711 "description": "Called when all the CSS has been inserted.", |
671 "parameters": [] | 712 "parameters": [] |
672 } | 713 } |
673 ] | 714 ] |
| 715 }, |
| 716 { |
| 717 "name": "setZoom", |
| 718 "type": "function", |
| 719 "description": "Zooms a specified tab.", |
| 720 "parameters": [ |
| 721 { |
| 722 "type": "integer", |
| 723 "name": "tabId", |
| 724 "minimum": 0, |
| 725 "optional": true, |
| 726 "description": "The ID of the tab to zoom; defaults to the active ta
b of the current window." |
| 727 }, |
| 728 { |
| 729 "type": "number", |
| 730 "name": "zoomFactor", |
| 731 "description": "The new zoom factor." |
| 732 }, |
| 733 { |
| 734 "type": "function", |
| 735 "name": "callback", |
| 736 "optional": true, |
| 737 "description": "Called after the zoom factor has been changed.", |
| 738 "parameters": [] |
| 739 } |
| 740 ] |
| 741 }, |
| 742 { |
| 743 "name": "getZoom", |
| 744 "type": "function", |
| 745 "description": "Gets the current zoom factor of a specified tab.", |
| 746 "parameters": [ |
| 747 { |
| 748 "type": "integer", |
| 749 "name": "tabId", |
| 750 "minimum": 0, |
| 751 "optional": true, |
| 752 "description": "The ID of the tab to get the current zoom factor fro
m; defaults to the active tab of the current window." |
| 753 }, |
| 754 { |
| 755 "type": "function", |
| 756 "name": "callback", |
| 757 "description": "Called with the tab's current zoom factor after it h
as been fetched.", |
| 758 "parameters": [ |
| 759 { |
| 760 "type": "number", |
| 761 "name": "zoomFactor", |
| 762 "description": "The tab's current zoom factor." |
| 763 } |
| 764 ] |
| 765 } |
| 766 ] |
| 767 }, |
| 768 { |
| 769 "name": "setZoomSettings", |
| 770 "type": "function", |
| 771 "description": "Sets the zoom settings for a specified tab, which define
how zoom changes are handled. These settings are reset to defaults upon navigat
ing the tab.", |
| 772 "parameters": [ |
| 773 { |
| 774 "type": "integer", |
| 775 "name": "tabId", |
| 776 "optional": true, |
| 777 "minimum": 0, |
| 778 "description": "The ID of the tab to change the zoom settings for; d
efaults to the active tab of the current window." |
| 779 }, |
| 780 { |
| 781 "$ref": "ZoomSettings", |
| 782 "name": "zoomSettings", |
| 783 "description": "Defines how zoom changes are handled and at what sco
pe." |
| 784 }, |
| 785 { |
| 786 "type": "function", |
| 787 "name": "callback", |
| 788 "description": "Called after the zoom settings have been changed.", |
| 789 "parameters": [] |
| 790 } |
| 791 ] |
| 792 }, |
| 793 { |
| 794 "name": "getZoomSettings", |
| 795 "type": "function", |
| 796 "description": "Gets the current zoom settings of a specified tab.", |
| 797 "parameters": [ |
| 798 { |
| 799 "type": "integer", |
| 800 "name": "tabId", |
| 801 "optional": true, |
| 802 "minimum": 0, |
| 803 "description": "The ID of the tab to get the current zoom settings f
rom; defaults to the active tab of the current window." |
| 804 }, |
| 805 { |
| 806 "type": "function", |
| 807 "name": "callback", |
| 808 "description": "Called with the tab's current zoom settings.", |
| 809 "parameters": [ |
| 810 { |
| 811 "$ref": "ZoomSettings", |
| 812 "name": "zoomSettings", |
| 813 "description": "The tab's current zoom settings." |
| 814 } |
| 815 ] |
| 816 } |
| 817 ] |
674 } | 818 } |
675 ], | 819 ], |
676 "events": [ | 820 "events": [ |
677 { | 821 { |
678 "name": "onCreated", | 822 "name": "onCreated", |
679 "type": "function", | 823 "type": "function", |
680 "description": "Fired when a tab is created. Note that the tab's URL may
not be set at the time this event fired, but you can listen to onUpdated events
to be notified when a URL is set.", | 824 "description": "Fired when a tab is created. Note that the tab's URL may
not be set at the time this event fired, but you can listen to onUpdated events
to be notified when a URL is set.", |
681 "parameters": [ | 825 "parameters": [ |
682 { | 826 { |
683 "$ref": "Tab", | 827 "$ref": "Tab", |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
914 ] | 1058 ] |
915 }, | 1059 }, |
916 { | 1060 { |
917 "name": "onReplaced", | 1061 "name": "onReplaced", |
918 "type": "function", | 1062 "type": "function", |
919 "description": "Fired when a tab is replaced with another tab due to pre
rendering or instant.", | 1063 "description": "Fired when a tab is replaced with another tab due to pre
rendering or instant.", |
920 "parameters": [ | 1064 "parameters": [ |
921 {"type": "integer", "name": "addedTabId", "minimum": 0}, | 1065 {"type": "integer", "name": "addedTabId", "minimum": 0}, |
922 {"type": "integer", "name": "removedTabId", "minimum": 0} | 1066 {"type": "integer", "name": "removedTabId", "minimum": 0} |
923 ] | 1067 ] |
| 1068 }, |
| 1069 { |
| 1070 "name": "onZoomChange", |
| 1071 "type": "function", |
| 1072 "description": "Fired when a tab is zoomed.", |
| 1073 "parameters": [{ |
| 1074 "type": "object", |
| 1075 "name": "ZoomChangeInfo", |
| 1076 "properties": { |
| 1077 "tabId": {"type": "integer", "minimum": 0}, |
| 1078 "oldZoomFactor": {"type": "number"}, |
| 1079 "newZoomFactor": {"type": "number"}, |
| 1080 "zoomSettings": {"$ref": "ZoomSettings"} |
| 1081 } |
| 1082 }] |
924 } | 1083 } |
925 ] | 1084 ] |
926 } | 1085 } |
927 ] | 1086 ] |
OLD | NEW |