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

Side by Side Diff: chrome/common/extensions/docs/examples/api/devtools/panels/chrome-query/devtools.js

Issue 9289057: Changing manifest to v2 extension samples (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Adding zip files after rebasing with master Created 8 years, 10 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
OLDNEW
1 <html> 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 <body> 2 // Use of this source code is governed by a BSD-style license that can be
3 <script type="text/javascript"> 3 // found in the LICENSE file.
4
4 // The function below is executed in the context of the inspected page. 5 // The function below is executed in the context of the inspected page.
5 var page_getProperties = function() { 6 var page_getProperties = function() {
6 var data = window.jQuery && $0 ? jQuery.data($0) : {}; 7 var data = window.jQuery && $0 ? jQuery.data($0) : {};
7 // Make a shallow copy with a null prototype, so that sidebar does not 8 // Make a shallow copy with a null prototype, so that sidebar does not
8 // expose prototype. 9 // expose prototype.
9 var props = Object.getOwnPropertyNames(data); 10 var props = Object.getOwnPropertyNames(data);
10 var copy = { __proto__: null }; 11 var copy = { __proto__: null };
11 for (var i = 0; i < props.length; ++i) 12 for (var i = 0; i < props.length; ++i)
12 copy[props[i]] = data[props[i]]; 13 copy[props[i]] = data[props[i]];
13 return copy; 14 return copy;
14 } 15 }
15 16
16 chrome.devtools.panels.elements.createSidebarPane( 17 chrome.devtools.panels.elements.createSidebarPane(
17 "jQuery Properties", 18 "jQuery Properties",
18 function(sidebar) { 19 function(sidebar) {
19 function updateElementProperties() { 20 function updateElementProperties() {
20 sidebar.setExpression("(" + page_getProperties.toString() + ")()"); 21 sidebar.setExpression("(" + page_getProperties.toString() + ")()");
21 } 22 }
22 updateElementProperties(); 23 updateElementProperties();
23 chrome.devtools.panels.elements.onSelectionChanged.addListener( 24 chrome.devtools.panels.elements.onSelectionChanged.addListener(
24 updateElementProperties); 25 updateElementProperties);
25 }); 26 });
26 </script>
27 </body>
28 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698