‘$’ already defined in Chrome?

$ is a local variable injected in your console from the __commandLineAPI object, via a with statement wrapping your code (that’s why it’s not a global variable). If you inspect it more closely (using e.g. debugger; $('*');), you’ll also see that it is basically a function bound to the current window with the following source:

$: function (selector, opt_startNode) {
    if (this._canQuerySelectorOnNode(opt_startNode))
        return opt_startNode.querySelector(selector);

    return inspectedWindow.document.querySelector(selector);
}

(defined on CommandLineAPIImpl.prototype)

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)