OLD | NEW |
---|---|
1 <p> | 1 <p> |
2 Use page actions to put icons inside the address bar. | 2 Use page actions to put icons inside the address bar. |
3 Page actions represent actions | 3 Page actions represent actions |
4 that can be taken on the current page, | 4 that can be taken on the current page, |
5 but that aren't applicable to all pages. | 5 but that aren't applicable to all pages. |
6 Some examples: | 6 Some examples: |
7 </p> | 7 </p> |
8 <ul> | 8 <ul> |
9 <li> Subscribe to this page's RSS feed </li> | 9 <li> Subscribe to this page's RSS feed </li> |
10 <li> Make a slideshow out of this page's photos </li> | 10 <li> Make a slideshow out of this page's photos </li> |
(...skipping 25 matching lines...) Expand all Loading... | |
36 <p> | 36 <p> |
37 Register your page action in the | 37 Register your page action in the |
38 <a href="manifest.html">extension manifest</a> | 38 <a href="manifest.html">extension manifest</a> |
39 like this: | 39 like this: |
40 </p> | 40 </p> |
41 | 41 |
42 <pre>{ | 42 <pre>{ |
43 "name": "My extension", | 43 "name": "My extension", |
44 ... | 44 ... |
45 <b>"page_action": { | 45 <b>"page_action": { |
46 "default_icon": "icons/foo.png", <em>// optional</em> | 46 "default_icon": { <em>// optional</em> |
47 "default_title": "Do action", <em>// optional; shown in tooltip</em> | 47 "19": "images/icon19.png", <em>// optional</em> |
48 "default_popup": "popup.html" <em>// optional</em> | 48 "38": "images/icon38.png" <em>// optional</em> |
49 }, | |
50 "default_title": "Google Mail", <em>// optional; shown in tooltip</em> | |
51 "default_popup": "popup.html" <em>// optional</em> | |
49 }</b>, | 52 }</b>, |
50 ... | 53 ... |
51 }</pre> | 54 }</pre> |
55 | |
56 <p> | |
57 If you don't care about icon appearance when screens's device-independent | |
Jeffrey Yasskin
2012/09/17 20:18:39
Ditto from browserAction.html.
tbarzic
2012/09/17 22:06:10
Done.
| |
58 pixel (dip) size is different than its physical pixel size, you can register | |
59 the default icon like this: | |
60 </p> | |
61 | |
62 <pre>{ | |
63 "name": "My extension", | |
64 ... | |
65 <b>"page_action": { | |
66 ... | |
67 "default_icon": "images/icon19.png" <em>// optional</em> | |
68 <em>// equal to "default_icon": { "19": "images/icon19.png" }</em> | |
69 }</b>, | |
70 ... | |
71 }</pre> | |
52 | 72 |
53 <h2 id="ui">Parts of the UI</h2> | 73 <h2 id="ui">Parts of the UI</h2> |
54 | 74 |
55 <p> | 75 <p> |
56 Like browser actions, | 76 Like browser actions, |
57 page actions can have an icon, | 77 page actions can have an icon, |
58 a tooltip, and popup; | 78 a tooltip, and popup; |
59 they can't have badges, however. | 79 they can't have badges, however. |
60 In addition, page actions can appear and disappear. | 80 In addition, page actions can appear and disappear. |
61 You can find information about icons, tooltips, and popups | 81 You can find information about icons, tooltips, and popups |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
98 | 118 |
99 | 119 |
100 <h2 id="examples"> Examples </h2> | 120 <h2 id="examples"> Examples </h2> |
101 | 121 |
102 <p> | 122 <p> |
103 You can find simple examples of using page actions in the | 123 You can find simple examples of using page actions in the |
104 <a href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extension s/docs/examples/api/pageAction/">examples/api/pageAction</a> | 124 <a href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extension s/docs/examples/api/pageAction/">examples/api/pageAction</a> |
105 directory. | 125 directory. |
106 For other examples and for help in viewing the source code, see | 126 For other examples and for help in viewing the source code, see |
107 <a href="samples.html">Samples</a>. | 127 <a href="samples.html">Samples</a>. |
108 </p> | 128 </p> |
OLD | NEW |