code: function( url ) {
              var match = url.match(/^([a-z]+:)\/\//i);
              if ( match === null ) {
                  // Relative URL, retrive the protocol from window.location
                  return window.location.protocol;
              }
              return match[1].toLowerCase();
          }
docs: Retrieves the protocol used by the url. The url can either be absolute
  or relative.
  @function
  @private
  @param {String} url The url to retrieve the protocol from.
  @return {String} The protocol (http:, https:, file:, ftp: ...)