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

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

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 <html>
2 <body> 2 <body>
3 <script type="text/javascript"> 3 <script src="devtools.js"></script>
4 // The function below is executed in the context of the inspected page.
5 var page_getProperties = function() {
6 var data = window.jQuery && $0 ? jQuery.data($0) : {};
7 // Make a shallow copy with a null prototype, so that sidebar does not
8 // expose prototype.
9 var props = Object.getOwnPropertyNames(data);
10 var copy = { __proto__: null };
11 for (var i = 0; i < props.length; ++i)
12 copy[props[i]] = data[props[i]];
13 return copy;
14 }
15
16 chrome.devtools.panels.elements.createSidebarPane(
17 "jQuery Properties",
18 function(sidebar) {
19 function updateElementProperties() {
20 sidebar.setExpression("(" + page_getProperties.toString() + ")()");
21 }
22 updateElementProperties();
23 chrome.devtools.panels.elements.onSelectionChanged.addListener(
24 updateElementProperties);
25 });
26 </script>
27 </body> 4 </body>
28 </html> 5 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698