OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 /** |
| 6 * @fileoverview Javascript that is being injected into the inspectable page |
| 7 * while debugging. |
| 8 */ |
| 9 goog.provide('devtools.Injected'); |
| 10 |
| 11 |
| 12 /** |
| 13 * Main injected object. |
| 14 * @constructor. |
| 15 */ |
| 16 devtools.Injected = function() { |
| 17 }; |
| 18 |
| 19 |
| 20 /** |
| 21 * Dispatches given method with given args on the host object. |
| 22 * @param {string} method Method name. |
| 23 */ |
| 24 devtools.Injected.prototype.InspectorController = function(method, var_args) { |
| 25 var args = Array.prototype.slice.call(arguments, 1); |
| 26 return InspectorController[method].apply(InspectorController, args); |
| 27 }; |
| 28 |
| 29 |
| 30 /** |
| 31 * Dispatches given method with given args on the InjectedScript. |
| 32 * @param {string} method Method name. |
| 33 */ |
| 34 devtools.Injected.prototype.InjectedScript = function(method, var_args) { |
| 35 var args = Array.prototype.slice.call(arguments, 1); |
| 36 var result = InjectedScript[method].apply(InjectedScript, args); |
| 37 return result; |
| 38 }; |
| 39 |
| 40 |
| 41 // Plugging into upstreamed support. |
| 42 InjectedScript._window = function() { |
| 43 return contentWindow; |
| 44 }; |
| 45 |
| 46 |
| 47 // Plugging into upstreamed support. |
| 48 Object.className = function(obj) { |
| 49 return (obj == null) ? "null" : obj.constructor.name; |
| 50 }; |
OLD | NEW |