Skip to content

Commit

Permalink
Remove IE8/9 support
Browse files Browse the repository at this point in the history
  • Loading branch information
steel committed Jun 16, 2016
1 parent 200dcdf commit b87cf18
Showing 1 changed file with 0 additions and 45 deletions.
45 changes: 0 additions & 45 deletions javascript/lib/long_poll_transport.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -109,49 +109,4 @@ class LongPollTransport extends Transport
# Reconnect with delay
setTimeout @_request, @_retryDelay

# Let's try to hack in support for IE8-9 via the XDomainRequest object!
# This was adapted from code shamelessly stolen from:
# https://github.com/jaubourg/ajaxHooks/blob/master/src/ajax/xdr.js
if $?.browser?.msie and parseInt($.browser.version, 10) in [8, 9]
jQuery.ajaxTransport (s) ->
if s.crossDomain and s.async and s.firehose
if s.timeout
s.xdrTimeout = s.timeout
delete s.timeout
xdr = undefined
return {
send: (_, complete) ->
callback = (status, statusText, responses, responseHeaders) ->
xdr.onload = xdr.onerror = xdr.ontimeout = jQuery.noop
xdr = undefined
complete status, statusText, responses, responseHeaders

xdr = new XDomainRequest()

xdr.open s.type, s.url

xdr.onload = ->
headers = "Content-Type: #{xdr.contentType}"
callback 200, "OK", {text: xdr.responseText}, headers

xdr.onerror = -> callback 404, "Not Found"

# This is critical for long poll to work in IE9.
# Without it, the initial request will work but
# subsequent requests will fail silently.
# http://social.msdn.microsoft.com/Forums/ie/en-US/30ef3add-767c-4436-b8a9-f1ca19b4812e/ie9-rtm-xdomainrequest-issued-requests-may-abort-if-all-event-handlers-not-specified?forum=iewebdevelopment
xdr.onprogress = -> {}

if s.xdrTimeout?
xdr.ontimeout = -> callback 0, "timeout"
xdr.timeout = s.xdrTimeout

xdr.send (s.hasContent and s.data) or null

abort: ->
if xdr?
xdr.onerror = jQuery.noop()
xdr.abort()
}

module.exports = LongPollTransport

0 comments on commit b87cf18

Please sign in to comment.