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

Side by Side Diff: chrome/common/extensions/docs/examples/api/webNavigation/basic/background.html

Issue 8318001: Adding `content_security_policy` to a few sample extensions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Docs. Zips. Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 <!doctype html> 1 <!doctype html>
2 <!-- 2 <!--
3 * Copyright (c) 2011 The Chromium Authors. All rights reserved. Use of this 3 * Copyright (c) 2011 The Chromium Authors. All rights reserved. Use of this
4 * source code is governed by a BSD-style license that can be found in the 4 * source code is governed by a BSD-style license that can be found in the
5 * LICENSE file. 5 * LICENSE file.
6 --> 6 -->
7 <html> 7 <html>
8 <head> 8 <head>
9 <title>WebNavigation Sample Extension Background Page</title> 9 <title>WebNavigation Sample Extension Background Page</title>
10 </head> 10 </head>
11 <body> 11 <body>
12 <script src='./navigation_collector.js'></script> 12 <script src='navigation_collector.js'></script>
13 <script> 13 <script src='background.js'></script>
14 var nav = new NavigationCollector();
15
16 var eventList = ['onBeforeNavigate', 'onCreatedNavigationTarget',
17 'onCommitted', 'onCompleted', 'onDOMContentLoaded',
18 'onErrorOccurred', 'onReferenceFragmentUpdated'];
19
20 eventList.forEach(function(e) {
21 chrome.webNavigation[e].addListener(function(data) {
22 if (typeof data)
23 console.log(chrome.i18n.getMessage('inHandler'), e, data);
24 else
25 console.error(chrome.i18n.getMessage('inHandlerError'), e);
26 });
27 });
28 </script>
29 </body> 14 </body>
30 </html> 15 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698