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

Side by Side Diff: webkit/glue/devtools/js/inject.js

Issue 149174: DevTools: do console evaluations in the global context of the inspected window (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview Javascript that is being injected into the inspectable page 6 * @fileoverview Javascript that is being injected into the inspectable page
7 * while debugging. 7 * while debugging.
8 */ 8 */
9 goog.provide('devtools.Injected'); 9 goog.provide('devtools.Injected');
10 10
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 }; 537 };
538 538
539 539
540 /** 540 /**
541 * Caches console object for subsequent calls to getConsoleObjectProperties. 541 * Caches console object for subsequent calls to getConsoleObjectProperties.
542 * @param {Object} obj Object to cache. 542 * @param {Object} obj Object to cache.
543 * @return {string} console object id. 543 * @return {string} console object id.
544 */ 544 */
545 devtools.Injected.prototype.evaluate = function(expression) { 545 devtools.Injected.prototype.evaluate = function(expression) {
546 try { 546 try {
547 return [ this.wrapConsoleObject(window.eval(expression)), false ]; 547 // Evaluate the expression in the global context of the inspected window.
548 return [ this.wrapConsoleObject(contentWindow.eval(expression)), false ];
548 } catch (e) { 549 } catch (e) {
549 return [ e.toString(), true ]; 550 return [ e.toString(), true ];
550 } 551 }
551 }; 552 };
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698