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

Side by Side Diff: chrome/common/extensions/docs/examples/extensions/imageinfo/background.html

Issue 8310002: Adding `content_security_policy` to imageinfo extension. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Docs. Created 9 years, 2 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <!-- 2 <!--
3 * Copyright (c) 2010 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 9 <title>Background Page</title>
10 </head> 10 </head>
11 <body> 11 <body>
12 <script> 12 <script src="background.js"></script>
13 /**
14 * Returns a handler which will open a new window when activated.
15 */
16 function getClickHandler() {
17 return function(info, tab) {
18
19 // The srcUrl property is only available for image elements.
20 var url = 'info.html#' + info.srcUrl;
21
22 // Create a new window to the info page.
23 chrome.windows.create({ url: url, width: 520, height: 660 });
24 };
25 };
26
27 /**
28 * Create a context menu which will only show up for images.
29 */
30 chrome.contextMenus.create({
31 "title" : "Get image info",
32 "type" : "normal",
33 "contexts" : ["image"],
34 "onclick" : getClickHandler()
35 });
36 </script>
37 </body> 13 </body>
38 </html> 14 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698