| 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 only provide one of the 19px or 38px icon size, the extension system will |
| 58 scale the icon you provide to the pixel density of the user's display, which |
| 59 can lose detail or make it look fuzzy. The old syntax for registering the |
| 60 default icon is still supported: |
| 61 </p> |
| 62 |
| 63 <pre>{ |
| 64 "name": "My extension", |
| 65 ... |
| 66 <b>"page_action": { |
| 67 ... |
| 68 "default_icon": "images/icon19.png" <em>// optional</em> |
| 69 <em>// equivalent to "default_icon": { "19": "images/icon19.png" }</em> |
| 70 }</b>, |
| 71 ... |
| 72 }</pre> |
| 52 | 73 |
| 53 <h2 id="ui">Parts of the UI</h2> | 74 <h2 id="ui">Parts of the UI</h2> |
| 54 | 75 |
| 55 <p> | 76 <p> |
| 56 Like browser actions, | 77 Like browser actions, |
| 57 page actions can have an icon, | 78 page actions can have an icon, |
| 58 a tooltip, and popup; | 79 a tooltip, and popup; |
| 59 they can't have badges, however. | 80 they can't have badges, however. |
| 60 In addition, page actions can appear and disappear. | 81 In addition, page actions can appear and disappear. |
| 61 You can find information about icons, tooltips, and popups | 82 You can find information about icons, tooltips, and popups |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 | 119 |
| 99 | 120 |
| 100 <h2 id="examples"> Examples </h2> | 121 <h2 id="examples"> Examples </h2> |
| 101 | 122 |
| 102 <p> | 123 <p> |
| 103 You can find simple examples of using page actions in the | 124 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> | 125 <a href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extension
s/docs/examples/api/pageAction/">examples/api/pageAction</a> |
| 105 directory. | 126 directory. |
| 106 For other examples and for help in viewing the source code, see | 127 For other examples and for help in viewing the source code, see |
| 107 <a href="samples.html">Samples</a>. | 128 <a href="samples.html">Samples</a>. |
| 108 </p> | 129 </p> |
| OLD | NEW |