summaryrefslogtreecommitdiffstats
path: root/chrome/common/extensions/docs/static/content_scripts.html
diff options
context:
space:
mode:
authorkathyw@chromium.org <kathyw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-22 00:02:26 +0000
committerkathyw@chromium.org <kathyw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-22 00:02:26 +0000
commit08df216dff7bf0f9df3042e40e62c089d88c290b (patch)
tree911f8bc9e557b9ab5776f3f42d10819e28a87cae /chrome/common/extensions/docs/static/content_scripts.html
parentbff4d3edb9b4001ec46519bbc020d806bf000ad9 (diff)
downloadchromium_src-08df216dff7bf0f9df3042e40e62c089d88c290b.zip
chromium_src-08df216dff7bf0f9df3042e40e62c089d88c290b.tar.gz
chromium_src-08df216dff7bf0f9df3042e40e62c089d88c290b.tar.bz2
Add M13 info to release notes and xhr/content script pages.
I'll merge this change into only the dev and beta channels. BUG=none TEST=http://code.google.com/chrome/extensions/whats_new.html has M12 info but not (yet) M13 info; http://code.google.com/chrome/extensions/dev/whats_new.html has M13 info Review URL: http://codereview.chromium.org/7215042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89936 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/extensions/docs/static/content_scripts.html')
-rw-r--r--chrome/common/extensions/docs/static/content_scripts.html38
1 files changed, 13 insertions, 25 deletions
diff --git a/chrome/common/extensions/docs/static/content_scripts.html b/chrome/common/extensions/docs/static/content_scripts.html
index 2022d9e..972f9d5 100644
--- a/chrome/common/extensions/docs/static/content_scripts.html
+++ b/chrome/common/extensions/docs/static/content_scripts.html
@@ -37,9 +37,6 @@ They <b>cannot</b>:
<li>
Use variables or functions defined by web pages or by other content scripts
</li>
- <li>
- Make <a href="xhr.html">cross-site XMLHttpRequests</a>
- </li>
</ul>
<p>
@@ -50,6 +47,9 @@ and request extension actions
by exchanging <a href="messaging.html">messages</a>
with their parent extension.
Content scripts can also
+make <a href="xhr.html">cross-site XMLHttpRequests</a>
+to the same sites as their parent extensions,
+and they can
<a href="#host-page-communication">communicate with web pages</a>
using the shared DOM.
For more insight into what content scripts can and can't do,
@@ -141,7 +141,7 @@ can have the following properties:</p>
<td><em>Optional.</em>
The list of JavaScript files to be injected into matching pages. These are injected in the order they appear in this array.</td>
</tr>
- <tr>
+ <tr id="run_at">
<td><code>run_at<code></td>
<td>string</td>
<td><em>Optional.</em>
@@ -369,9 +369,9 @@ document.getElementById('myCustomEventDiv').addEventListener('myCustomEvent', fu
<p>When writing a content script, you should be aware of two security issues.
First, be careful not to introduce security vulnerabilities into the web site
your content script is injected into. For example, if your content script
-receives content from another web site (e.g., by <a
-href="messaging.html">asking your background page to make an
-XMLHttpRequest</a>), be careful to filter that content for <a
+receives content from another web site (for example, by making an <a
+href="messaging.html">XMLHttpRequest</a>),
+be careful to filter that content for <a
href="http://en.wikipedia.org/wiki/Cross-site_scripting">cross-site
scripting</a> attacks before injecting the content into the current page.
For example, prefer to inject content via innerText rather than innerHTML.
@@ -432,27 +432,15 @@ document.getElementById("someImage").src = imgURL;
<h2 id="examples"> Examples </h2>
<p>
-The
-<a href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extensions/docs/examples/howto/contentscript_xhr">contentscript_xhr</a> example
-shows how an extension can perform
-cross-site requests for its content script.
-You can find other simple examples of communication via messages in the
-<a href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extensions/docs/examples/api/messaging/">examples/api/messaging</a>
-directory.
-</p>
-
-<p>
-See
-<a href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extensions/docs/examples/api/browserAction/make_page_red/">make_page_red</a> and
-<a href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extensions/docs/examples/extensions/email_this_page/">email_this_page</a>
+You can find many
+<a href="samples.html#script">examples that use content scripts</a>.
+A simple example of communication via messages is in the
+<a href="samples.html#51a83d2ba3a32e3ff1bdb624d4e18ccec4c4038e">timer sample</a>.
+See <a href="samples.html#ede3c47b7757245be42ec33fd5ca63df4b490066">make_page_red</a> and
+<a href="samples.html#028eb5364924344029bcbe1d527f132fc72b34e5">email_this_page</a>
for examples of programmatic injection.
-
</p>
-<p>
-For more examples and for help in viewing the source code, see
-<a href="samples.html">Samples</a>.
-</p>
<h2 id="videos"> Videos </h2>