Opened 7 years ago

Closed 4 years ago

#16391 closed defect (fixed)

dojox/socket relies on document.baseURI, which is not supported by IE

Reported by: thomasneirynck Owned by: Kris Zyp
Priority: undecided Milestone: 1.7.9
Component: Dojox Version: 1.8.1
Keywords: Cc: Colin Snover
Blocked By: Blocking:

Description

Description

The dojox/socket module relies on the document.baseURI property. This is not supported by Internet Explorer (I verified this for versions 9 and 10)

Resolution

I would suggest to replace the occurrence of document.baseURI with window.location.href.

Code highlighting:

var baseURI = window.location.href;
if (typeof baseURI !== 'string'){
    //try fallbacks
    baseURI = (document.URL || ((document.location) ? document.location.href : document.baseURI));
}
var ws = new WebSocket(new dojo._Url(baseURI.replace(/^http/i,'ws'), args.url));

As opposed to the buggy original:

Code highlighting:

var ws = new WebSocket(new dojo._Url(document.baseURI.replace(/^http/i,'ws'), args.url));

Attachments (1)

Socket.js.patch (579 bytes) - added by vita 7 years ago.
IE10 simple patch

Download all attachments as: .zip

Change History (5)

comment:1 Changed 7 years ago by Adam Peller

Cc: Colin Snover added
Owner: changed from Adam Peller to Kris Zyp
Status: newassigned

Changed 7 years ago by vita

Attachment: Socket.js.patch added

IE10 simple patch

comment:2 Changed 5 years ago by ben hockey

#17661 is a duplicate of this ticket.

comment:3 Changed 5 years ago by Jared Jurkiewicz

Note: See TracTickets for help on using tickets.