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

Side by Side Diff: chrome/common/extensions/docs/examples/api/webNavigation/basic/popup.js

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
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 /**
6 * @filedescription Initializes the extension's popup page.
7 */
8
9 chrome.extension.sendRequest(
10 {'type': 'getMostRequestedUrls'},
11 function generateList(response) {
12 var section = document.querySelector('body>section');
13 var results = response.result;
14 var ol = document.createElement('ol');
15 var li, p, em, code, text;
16 var i;
17 for (i = 0; i < results.length; i++ ) {
18 li = document.createElement('li');
19 p = document.createElement('p');
20 em = document.createElement('em');
21 em.textContent = i + 1;
22 code = document.createElement('code');
23 code.textContent = results[i].url;
24 text = document.createTextNode(
25 chrome.i18n.getMessage('navigationDescription',
26 [results[i].numRequests,
27 results[i].average]));
28 p.appendChild(em);
29 p.appendChild(code);
30 p.appendChild(text);
31 li.appendChild(p);
32 ol.appendChild(li);
33 }
34 section.innerHTML = '';
35 section.appendChild(ol);
36 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698