OLD | NEW |
1 <div id="pageData-name" class="pageData">Message Passing</div> | 1 <h1>Message Passing</h1> |
2 <div id="pageData-showTOC" class="pageData">true</div> | 2 |
3 | 3 |
4 <p> | 4 <p> |
5 Since content scripts run in the context of a web page and not the extension, | 5 Since content scripts run in the context of a web page and not the extension, |
6 they often need some way of communicating with the rest of the extension. For | 6 they often need some way of communicating with the rest of the extension. For |
7 example, an RSS reader extension might use content scripts to detect the | 7 example, an RSS reader extension might use content scripts to detect the |
8 presence of an RSS feed on a page, then notify the background page in order to | 8 presence of an RSS feed on a page, then notify the background page in order to |
9 display a page action icon for that page. | 9 display a page action icon for that page. |
10 | 10 |
11 <p> | 11 <p> |
12 Communication between extensions and their content scripts works by using | 12 Communication between extensions and their content scripts works by using |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 You can find simple examples of communication via messages in the | 265 You can find simple examples of communication via messages in the |
266 <a href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extension
s/docs/examples/api/messaging/">examples/api/messaging</a> | 266 <a href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extension
s/docs/examples/api/messaging/">examples/api/messaging</a> |
267 directory. | 267 directory. |
268 Also see the | 268 Also see the |
269 <a href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extension
s/docs/examples/howto/contentscript_xhr">contentscript_xhr</a> example, | 269 <a href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extension
s/docs/examples/howto/contentscript_xhr">contentscript_xhr</a> example, |
270 in which a content script and its parent extension exchange messages, | 270 in which a content script and its parent extension exchange messages, |
271 so that the parent extension can perform | 271 so that the parent extension can perform |
272 cross-site requests on behalf of the content script. | 272 cross-site requests on behalf of the content script. |
273 For more examples and for help in viewing the source code, see | 273 For more examples and for help in viewing the source code, see |
274 <a href="samples.html">Samples</a>. | 274 <a href="samples.html">Samples</a>. |
275 </p> | 275 </p> |
OLD | NEW |