Changeset 49988 in webkit


Ignore:
Timestamp:
Oct 23, 2009 12:30:54 PM (14 years ago)
Author:
eric@webkit.org
Message:

2009-10-23 Keishi Hattori <casey.hattori@gmail.com>

Reviewed by Timothy Hatcher.

Inspector injects _inspectorCommandLineAPI into global object when opened
https://bugs.webkit.org/show_bug.cgi?id=30675

  • inspector/front-end/InjectedScript.js: (InjectedScript.getCompletions): (InjectedScript._evaluateOn): (InjectedScript.addInspectedNode): (InjectedScript._ensureCommandLineAPIInstalled): Moved _inspectorCommandLineAPI from window to console.
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r49987 r49988  
     12009-10-23  Keishi Hattori  <casey.hattori@gmail.com>
     2
     3        Reviewed by Timothy Hatcher.
     4
     5        Inspector injects _inspectorCommandLineAPI into global object when opened
     6        https://bugs.webkit.org/show_bug.cgi?id=30675
     7
     8        * inspector/front-end/InjectedScript.js:
     9        (InjectedScript.getCompletions):
     10        (InjectedScript._evaluateOn):
     11        (InjectedScript.addInspectedNode):
     12        (InjectedScript._ensureCommandLineAPIInstalled): Moved _inspectorCommandLineAPI from window to console.
     13
    1142009-10-23  Janne Koskinen  <janne.p.koskinen@digia.com>
    215
  • trunk/WebCore/inspector/front-end/InjectedScript.js

    r49940 r49988  
    541541                props[prop] = true;
    542542        if (includeInspectorCommandLineAPI)
    543             for (var prop in InjectedScript._window()._inspectorCommandLineAPI)
     543            for (var prop in InjectedScript._window().console._inspectorCommandLineAPI)
    544544                if (prop.charAt(0) !== '_')
    545545                    props[prop] = true;
     
    576576    // Surround the expression in with statements to inject our command line API so that
    577577    // the window object properties still take more precedent than our API functions.
    578     expression = "with (window._inspectorCommandLineAPI) { with (window) { " + expression + " } }";
     578    expression = "with (window.console._inspectorCommandLineAPI) { with (window) { " + expression + " } }";
    579579    var value = evalFunction.call(object, expression);
    580580
     
    593593
    594594    InjectedScript._ensureCommandLineAPIInstalled(InjectedScript._window().eval, InjectedScript._window());
    595     var inspectedNodes = InjectedScript._window()._inspectorCommandLineAPI._inspectedNodes;
     595    var inspectedNodes = InjectedScript._window().console._inspectorCommandLineAPI._inspectedNodes;
    596596    inspectedNodes.unshift(node);
    597597    if (inspectedNodes.length >= 5)
     
    902902InjectedScript._ensureCommandLineAPIInstalled = function(evalFunction, evalObject)
    903903{
    904     if (evalFunction.call(evalObject, "window._inspectorCommandLineAPI"))
     904    if (evalFunction.call(evalObject, "window.console._inspectorCommandLineAPI"))
    905905        return;
    906     var inspectorCommandLineAPI = evalFunction.call(evalObject, "window._inspectorCommandLineAPI = { \
     906    var inspectorCommandLineAPI = evalFunction.call(evalObject, "window.console._inspectorCommandLineAPI = { \
    907907        $: function() { return document.getElementById.apply(document, arguments) }, \
    908908        $$: function() { return document.querySelectorAll.apply(document, arguments) }, \
     
    962962        }, \
    963963        _inspectedNodes: [], \
    964         get $0() { return _inspectorCommandLineAPI._inspectedNodes[0] }, \
    965         get $1() { return _inspectorCommandLineAPI._inspectedNodes[1] }, \
    966         get $2() { return _inspectorCommandLineAPI._inspectedNodes[2] }, \
    967         get $3() { return _inspectorCommandLineAPI._inspectedNodes[3] }, \
    968         get $4() { return _inspectorCommandLineAPI._inspectedNodes[4] } \
     964        get $0() { return console._inspectorCommandLineAPI._inspectedNodes[0] }, \
     965        get $1() { return console._inspectorCommandLineAPI._inspectedNodes[1] }, \
     966        get $2() { return console._inspectorCommandLineAPI._inspectedNodes[2] }, \
     967        get $3() { return console._inspectorCommandLineAPI._inspectedNodes[3] }, \
     968        get $4() { return console._inspectorCommandLineAPI._inspectedNodes[4] } \
    969969    };");
    970970
Note: See TracChangeset for help on using the changeset viewer.