javascript/selenium-core/scripts/selenium-remoterunner.js
function(commandRequest) {
        //decodeURIComponent doesn't strip plus signs
        var processed = commandRequest.replace(/\+/g, "%20");
        // strip trailing spaces
        var processed = processed.replace(/\s+$/, "");
        var vars = processed.split("&");
        var cmdArgs = new Object();
        for (var i = 0; i < vars.length; i++) {
            var pair = vars[i].split("=");
            cmdArgs[pair[0]] = pair[1];
        }
        var cmd = cmdArgs['cmd'];
        var arg1 = cmdArgs['1'];
        if (null == arg1) arg1 = "";
        arg1 = decodeURIComponent(arg1);
        var arg2 = cmdArgs['2'];
        if (null == arg2) arg2 = "";
        arg2 = decodeURIComponent(arg2);
        if (cmd == null) {
            throw new Error("Bad command request: " + commandRequest);
        }
        return new SeleniumCommand(cmd, arg1, arg2);
    }
function(commandRequest) {
        //decodeURIComponent doesn't strip plus signs
        var processed = commandRequest.replace(/\+/g, "%20");
        // strip trailing spaces
        var processed = processed.replace(/\s+$/, "");
        var vars = processed.split("&");
        var cmdArgs = new Object();
        for (var i = 0; i < vars.length; i++) {
            var pair = vars[i].split("=");
            cmdArgs[pair[0]] = pair[1];
        }
        var cmd = cmdArgs['cmd'];
        var arg1 = cmdArgs['1'];
        if (null == arg1) arg1 = "";
        arg1 = decodeURIComponent(arg1);
        var arg2 = cmdArgs['2'];
        if (null == arg2) arg2 = "";
        arg2 = decodeURIComponent(arg2);
        if (cmd == null) {
            throw new Error("Bad command request: " + commandRequest);
        }
        return new SeleniumCommand(cmd, arg1, arg2);
    }
function ( commandRequest ) { //decodeURIComponent doesn't strip plus signs var processed = commandRequest . replace ( / \+ / g , "%20" ) ; // strip trailing spaces var processed = processed . replace ( / \s+$ / , "" ) ; var vars = processed . split ( "&" ) ; var cmdArgs = new Object ( ) ; for ( var i = 0 ; i < vars . length ; i ++ ) { var pair = vars [ i ] . split ( "=" ) ; cmdArgs [ pair [ 0 ] ] = pair [ 1 ] ; } var cmd = cmdArgs [ 'cmd' ] ; var arg1 = cmdArgs [ '1' ] ; if ( null == arg1 ) arg1 = "" ; arg1 = decodeURIComponent ( arg1 ) ; var arg2 = cmdArgs [ '2' ] ; if ( null == arg2 ) arg2 = "" ; arg2 = decodeURIComponent ( arg2 ) ; if ( cmd == null ) { throw new Error ( "Bad command request: " + commandRequest ) ; } return new SeleniumCommand ( cmd , arg1 , arg2 ) ; }
Parses a URI query string into a SeleniumCommand object
Parses a URI query string into a SeleniumCommand object