* XHR Polling constructor. * * @param {Object} opts * @package
(opts)
| 1092 | * @package |
| 1093 | */ |
| 1094 | function Polling(opts) { |
| 1095 | var _this; |
| 1096 | _classCallCheck(this, Polling); |
| 1097 | _this = _super.call(this, opts); |
| 1098 | _this.polling = false; |
| 1099 | if (typeof location !== "undefined") { |
| 1100 | var isSSL = "https:" === location.protocol; |
| 1101 | var port = location.port; |
| 1102 | // some user agents have empty `location.port` |
| 1103 | if (!port) { |
| 1104 | port = isSSL ? "443" : "80"; |
| 1105 | } |
| 1106 | _this.xd = typeof location !== "undefined" && opts.hostname !== location.hostname || port !== opts.port; |
| 1107 | } |
| 1108 | /** |
| 1109 | * XHR supports binary |
| 1110 | */ |
| 1111 | var forceBase64 = opts && opts.forceBase64; |
| 1112 | _this.supportsBinary = hasXHR2 && !forceBase64; |
| 1113 | if (_this.opts.withCredentials) { |
| 1114 | _this.cookieJar = createCookieJar(); |
| 1115 | } |
| 1116 | return _this; |
| 1117 | } |
| 1118 | _createClass(Polling, [{ |
| 1119 | key: "name", |
| 1120 | get: function get() { |
nothing calls this directly
no test coverage detected