src/LiveDevelopment/Inspector/Inspector.js
function connectToURL(url) {
        if (_connectDeferred) {
            // reject an existing connection attempt
            _connectDeferred.reject("CANCEL");
        }
        var deferred = new $.Deferred();
        _connectDeferred = deferred;
        var promise = getDebuggableWindows();
        promise.done(function onGetAvailableSockets(response) {
            var i, page;
            for (i in response) {
                page = response[i];
                if (page.webSocketDebuggerUrl && page.url.indexOf(url) === 0) {
                    connect(page.webSocketDebuggerUrl);
                    // _connectDeferred may be resolved by onConnect or rejected by onError
                    return;
                }
            }
            deferred.reject(FileError.ERR_NOT_FOUND); // Reject with a "not found" error
        });
        promise.fail(function onFail(err) {
            deferred.reject(err);
        });
        return deferred.promise();
    }
function connectToURL(url) {
        if (_connectDeferred) {
            // reject an existing connection attempt
            _connectDeferred.reject("CANCEL");
        }
        var deferred = new $.Deferred();
        _connectDeferred = deferred;
        var promise = getDebuggableWindows();
        promise.done(function onGetAvailableSockets(response) {
            var i, page;
            for (i in response) {
                page = response[i];
                if (page.webSocketDebuggerUrl && page.url.indexOf(url) === 0) {
                    connect(page.webSocketDebuggerUrl);
                    // _connectDeferred may be resolved by onConnect or rejected by onError
                    return;
                }
            }
            deferred.reject(FileError.ERR_NOT_FOUND); // Reject with a "not found" error
        });
        promise.fail(function onFail(err) {
            deferred.reject(err);
        });
        return deferred.promise();
    }
function connectToURL ( url ) { if ( _connectDeferred ) { // reject an existing connection attempt _connectDeferred . reject ( "CANCEL" ) ; } var deferred = new $ . Deferred ( ) ; _connectDeferred = deferred ; var promise = getDebuggableWindows ( ) ; promise . done ( function onGetAvailableSockets ( response ) { var i , page ; for ( i in response ) { page = response [ i ] ; if ( page . webSocketDebuggerUrl && page . url . indexOf ( url ) === 0 ) { connect ( page . webSocketDebuggerUrl ) ; // _connectDeferred may be resolved by onConnect or rejected by onError return ; } } deferred . reject ( FileError . ERR_NOT_FOUND ) ; // Reject with a "not found" error } ) ; promise . fail ( function onFail ( err ) { deferred . reject ( err ) ; } ) ; return deferred . promise ( ) ; }
Connect to the remote debugger of the page that is at the given URL
@param {string} url
Connect to the remote debugger of the page that is at the given URL