Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3490)

Unified Diff: chrome/common/extensions/docs/static/options.html

Issue 10824073: Updating `options_page` documentation to work under CSP. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Status. Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/extensions/docs/extensions/options.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/docs/static/options.html
diff --git a/chrome/common/extensions/docs/static/options.html b/chrome/common/extensions/docs/static/options.html
index e0cc4b4b7b990513a5bc628f04cd5e055c908d99..5f8e273474f8f10c37bec703961dd54536b70d66 100644
--- a/chrome/common/extensions/docs/static/options.html
+++ b/chrome/common/extensions/docs/static/options.html
@@ -16,10 +16,7 @@
Here is an example options page:
-<pre>
-&lt;html>
-&lt;head>&lt;title>My Test Extension Options&lt;/title>&lt;/head>
-&lt;script type="text/javascript">
+<pre>// Save this script as `options.js`
// Saves options to localStorage.
function save_options() {
@@ -50,10 +47,16 @@ function restore_options() {
}
}
}
+document.addEventListener('DOMContentReady', restore_options);
+document.querySelector('#save').addEventListener('click', save_options);
+</pre>
-&lt;/script>
+<pre>
+&lt;html>
+&lt;head>&lt;title>My Test Extension Options&lt;/title>&lt;/head>
+&lt;script src="options.js">
-&lt;body onload="restore_options()">
+&lt;body>
Favorite Color:
&lt;select id="color">
@@ -64,7 +67,8 @@ Favorite Color:
&lt;/select>
&lt;br>
-&lt;button onclick="save_options()">Save&lt;/button>
+&lt;div id="status">&lt;/div>
+&lt;button id="save">Save&lt;/button>
&lt;/body>
&lt;/html>
</pre>
« no previous file with comments | « chrome/common/extensions/docs/extensions/options.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698