Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client-Library not working with IE8/9 #154

Closed
mrx8 opened this issue Feb 11, 2014 · 8 comments
Closed

Client-Library not working with IE8/9 #154

mrx8 opened this issue Feb 11, 2014 · 8 comments

Comments

@mrx8
Copy link

mrx8 commented Feb 11, 2014

Hi,
Im using Primus 1.5.1 at the moment.
I tested with IE10, IE9 and IE8. Each of them got Javascript errors in the primus-client-library.
Example: open http://primus-example.nodejitsu.com/ with IE8, 9
It only works for me with IE10/11.
I plan to use primus in production for an additional websocket-based service.
I used sockjs before which supported IE from IE6 onward, but decided to switch to primus to switch transformers if i must.
About 15% of my Users use IE8/9 so this is actually a showstopper for me.
I didn't find any minimal Browser requirements for primus in the documentation.
Is IE>=10 intentional, or could this be changed to supoort at least IE8 onwards ?

Regards
Andy

@3rd-Eden
Copy link
Member

See discussion at #117

It seems that for some reason SockJS isn't falling back correctly to other transports. I've marked this as an high priority bug, I have no ETA for a fix as we might have to revert #117 in order to fix this, but that would mean that other connections can get broken.

@pesho
Copy link

pesho commented Feb 11, 2014

According to the table "Supported transports, by browser" at https://github.com/sockjs/sockjs-client it seems like SockJS is trying transports in the intended order for IE8/9 (i.e. iframe-htmlfile first and iframe-xhr-polling second when cookie_needed is true). However, for some reason both these transports fail, and the connection is unsuccessful.

@mrx8
Copy link
Author

mrx8 commented Feb 11, 2014

I think this is an additional problem. My problem is that IE8 don't even parse the client-library
This is the excerpt of the primus.js from your/my example-link above:
IE8 says: "Member not found" in line 361
...
348 parse = function parse(url) {
349 var a = document.createElement('a')
350 , data = {}
351 , key;
352
353 a.href = url;
354
355 //
356 // Transform it from a readOnly object to a read/writable object so we can
357 // change some parsed values. This is required if we ever want to override
358 // a port number etc (as browsers remove port 443 and 80 from the urls).
359 //
360 for (key in a) {
361 if (a[key] && ('string' === typeof a[key] || +a[key])) {
362 data[key] = a[key];
363 }
364 }
...

@3rd-Eden
Copy link
Member

@mrx8 The issue that you're having is already fix in Primus. Which was #129

@3rd-Eden
Copy link
Member

(I just haven't redeployed the example yet with the latest version)

@mrx8
Copy link
Author

mrx8 commented Feb 11, 2014

You are too fast for me. Thanks in advance!
I will test with 2.0.0
Forgive my initital laziness :)

@3rd-Eden
Copy link
Member

Gonna close this as the original issue of this topic has been solved.

@gcmartijn
Copy link

I'm getting errors, but don't know why at the moment.

Maybe related with this topic.

First I did:

When emulation IE8 (in IE10) with this server:
npm uninstall primus
npm uninstall primus-rooms
npm uninstall engine.io

npm install git+https://github.com/primus/primus.git
npm install git+https://github.com/cayasso/primus-rooms.git
npm install git+https://github.com/LearnBoost/engine.io.git

primus = new Primus(server, {
transformer: 'engine.io', // websockets || engine.io
parser:'ejson' // JSON
})

the client code:
Primus.connect(this.host+'/?ns='+this.namespace,{
reconnect: {
maxDelay: Infinity,
minDelay: 500,
retries: 10
}
})

Then it works in ie10/chrome/firefox/safari
But in ie9/ie8 I get:

readyStateChange
outgoing::open
error
readyStateChange
outgoing::end
close
end
incoming::error
incoming::end

But gives me no error, (or ie don't give me the error) because i'm using:

.on('error', function(e){
console.log('error',e); <-- shows only 'error'
})

edit:
Found the breakpoint in IE8 debug mode.
The error is:
message "xhr poll error"
type "TransportError"
message "The property open or method is not supported by this object"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants