dist/client/lance-gg.js
/**
   * Polling transport polymorphic constructor.
   * Decides on xhr vs jsonp based on feature detection.
   *
   * @api private
   */
Polling transport polymorphic constructor.
Decides on xhr vs jsonp based on feature detection.

@api private
Polling transport polymorphic constructor . Decides on xhr vs jsonp based on feature detection . @api private
function polling$1(opts) {
    let xhr;
    let xd = false;
    let xs = false;
    const jsonp = false !== opts.jsonp;
    if (typeof location !== "undefined") {
      const isSSL = "https:" === location.protocol;
      let port = location.port;
      if (!port) {
        port = isSSL ? 443 : 80;
      }
      xd = opts.hostname !== location.hostname || port !== opts.port;
      xs = opts.secure !== isSSL;
    }
    opts.xdomain = xd;
    opts.xscheme = xs;
    xhr = new xmlhttprequest(opts);
    if ("open" in xhr && !opts.forceJSONP) {
      return new pollingXhr(opts);
    } else {
      if (!jsonp) throw new Error("JSONP disabled");
      return new pollingJsonp(opts);
    }
  }
function polling$1 ( opts ) { let xhr ; let xd = false ; let xs = false ; const jsonp = false !== opts . jsonp ; if ( typeof location !== "undefined" ) { const isSSL = "https:" === location . protocol ; let port = location . port ; if ( ! port ) { port = isSSL ? 443 : 80 ; } xd = opts . hostname !== location . hostname || port !== opts . port ; xs = opts . secure !== isSSL ; } opts . xdomain = xd ; opts . xscheme = xs ; xhr = new xmlhttprequest ( opts ) ; if ( "open" in xhr && ! opts . forceJSONP ) { return new pollingXhr ( opts ) ; } else { if ( ! jsonp ) throw new Error ( "JSONP disabled" ) ; return new pollingJsonp ( opts ) ; } }
Polling transport polymorphic constructor.
Polling transport polymorphic constructor .
// some user agents have empty `location.port`