From beea9c0efe410ae4579b9a194efad9387dbdbce9 Mon Sep 17 00:00:00 2001 From: "yurys@google.com" Date: Fri, 3 Jul 2009 10:54:57 +0000 Subject: DevTools: do console evaluations in the global context of the inspected window. That context is exposed as contentWindow global variable to inject.js by ResetUtilityContext method. Review URL: http://codereview.chromium.org/149174 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19903 0039d316-1c4b-4281-b951-d872f2087c98 --- webkit/glue/devtools/js/inject.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'webkit') diff --git a/webkit/glue/devtools/js/inject.js b/webkit/glue/devtools/js/inject.js index 7a88f30..f72e424 100644 --- a/webkit/glue/devtools/js/inject.js +++ b/webkit/glue/devtools/js/inject.js @@ -544,7 +544,8 @@ devtools.Injected.prototype.wrapConsoleObject = function(obj) { */ devtools.Injected.prototype.evaluate = function(expression) { try { - return [ this.wrapConsoleObject(window.eval(expression)), false ]; + // Evaluate the expression in the global context of the inspected window. + return [ this.wrapConsoleObject(contentWindow.eval(expression)), false ]; } catch (e) { return [ e.toString(), true ]; } -- cgit v1.1