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

Internet Explorer 11 causes Access Denied error in OpenLayers.Format.XML #1177

Closed
wants to merge 1 commit into from

Conversation

ahocevar
Copy link
Member

@ahocevar ahocevar commented Mar 6, 2014

Internet Explorer 11 causes a 0x80070005 - JavaScript runtime error: Access is denied.
in the OpenLayers.Format.XML class when the browser tries to open an XMLHttpRequest at the req.open(... statement.

...
function() {
var req = new XMLHttpRequest();
req.open("GET", "data:" + "text/xml" +
";charset=utf-8," + encodeURIComponent(text), false);

@marcjansen
Copy link
Member

Without testing it: it sounds like the browsers same origin policy is violated. Are you trying to do AJAX across domains? Which URL are you requesting, and from which domain is the request issued?

@marcjansen
Copy link
Member

Please reopen if you are sure you found a bug.

@marcjansen marcjansen closed this Nov 18, 2013
@cborcher
Copy link
Author

There are no AJAX calls anywhere unless the WMSGetFeatureInfo control issues them. This error occurs when you are trying to retrieve information with a click or hover on a WMS Layer using WMSGetFeatureInfo. The WMS server (MapServer) is located in the same domain as the openlayers program: http://www.nogcc.ne.gov/MapServer http://www.nogcc.ne.gov/MapServer and http://www.nogcc.ne.gov/olNOGCCOnlineGIS http://www.nogcc.ne.gov/olNOGCCOnlineGIS. Internet Explorer 10, Chrome and Firefox all execute correctly, Internet Explorer 11 does not. In production the error is not visible the WMSGetFeatureInfo functions simple do not execute. When run in debug mode through Visual Studio 12 this is the error returned.

Chuck Borcher

IT Infrastructure Support Tech.

Nebraska Oil and Gas Conservation Commission

P.O. Box 399

Sidney, NE 69162

308.254.6919

“If life gives you melons you might be dyslexic!”

From: Marc Jansen [mailto:notifications@github.com]
Sent: Sunday, November 17, 2013 3:20 AM
To: openlayers/openlayers
Cc: cborcher
Subject: Re: [openlayers] Internet Explorer 11 causes Access Denied error in OpenLayers.Format.XML (#1177)

Without testing it: it sounds like the browsers same origin policy is violated. Are you trying to do AJAX across domains? Which URL are you requesting, and from which domain is the request issued?


Reply to this email directly or view it on GitHub openlayers/openlayers#1177 (comment) . https://github.com/notifications/beacon/EAPZJEAo2p1_bfd2qZ2qqkW7CODZyajvF3Z8FxdHguq1GM5Tf78JHjNQHKoIzhK2.gif

@bartvde bartvde reopened this Nov 18, 2013
@bartvde
Copy link
Member

bartvde commented Nov 18, 2013

@cborcher are you able to test a build without XMLHttpRequest? IE11 really doesn't need this middle man library. See also: https://github.com/ilinsky/xmlhttprequest

Easiest way to test is to empty the file lib/OpenLayers/Request/XMLHttpRequest.js and create a new build using build.py

@cborcher
Copy link
Author

I can’t run build.py on a windows 8 machine. Please advise on another way to create a build.

Chuck Borcher

IT Infrastructure Support Tech.

Nebraska Oil and Gas Conservation Commission

P.O. Box 399

Sidney, NE 69162

308.254.6919

“If life gives you melons you might be dyslexic!”

From: Bart van den Eijnden [mailto:notifications@github.com]
Sent: Monday, November 18, 2013 11:41 AM
To: openlayers/openlayers
Cc: cborcher
Subject: Re: [openlayers] Internet Explorer 11 causes Access Denied error in OpenLayers.Format.XML (#1177)

@cborcher https://github.com/cborcher are you able to test a build without XMLHttpRequest? IE11 really doesn't need this middle man library. See also: https://github.com/ilinsky/xmlhttprequest

Easiest way to test is to empty the file lib/OpenLayers/Request/XMLHttpRequest.js and create a new build using build.py


Reply to this email directly or view it on GitHub openlayers/openlayers#1177 (comment) . https://github.com/notifications/beacon/EAPZJEAo2p1_bfd2qZ2qqkW7CODZyajvF3Z8FxdHguq1GM5Tf78JHjNQHKoIzhK2.gif

@bartvde
Copy link
Member

bartvde commented Nov 19, 2013

@cborcher what version of OpenLayers are you using? Are you using a hosted build?

What's the error on Windows 8 with build.py?

I can probably send you a custom build, bartvde [at] boundlessgeo [dot] com

@cborcher
Copy link
Author

The OpenLayers version is 2.12. Right now I am unable to test anything. Windows 8.1 crashed completely yesterday and required a reinstall. Will be at least another couple of days to get all the programs reinstalled.

From: Bart van den Eijnden [mailto:notifications@github.com]
Sent: Tuesday, November 19, 2013 12:44 AM
To: openlayers/openlayers
Cc: cborcher
Subject: Re: [openlayers] Internet Explorer 11 causes Access Denied error in OpenLayers.Format.XML (#1177)

@cborcher https://github.com/cborcher what version of OpenLayers are you using? Are you using a hosted build?

What's the error on Windows 8 with build.py?

I can probably send you a custom build, bartvde [at] boundlessgeo [dot] com


Reply to this email directly or view it on GitHub openlayers/openlayers#1177 (comment) . https://github.com/notifications/beacon/EAPZJEAo2p1_bfd2qZ2qqkW7CODZyajvF3Z8FxdHguq1GM5Tf78JHjNQHKoIzhK2.gif

@ahocevar
Copy link
Member

ahocevar commented Mar 6, 2014

Does the attached pull request fix the issue?

bkiselka pushed a commit to bkiselka/ol2 that referenced this pull request Mar 25, 2014
I think I experience the same problem of issue openlayers#1177

As an example I modified the GetFeatureInfo example injecting the corrupt data that cause the error in IE11. Just click in the map.

Obviously the not valid HTML5 is can't be read with DomParser() in IE11.
One solution is pull request openlayers#1285

Another solution may be to check the INFO_FORMAT and do not call
var features = this.format.read(doc);
if it is text/html or text/plain (i.e. not a GML) as in showInfo() just the text is used (no GML features):
document.getElementById('responseText').innerHTML = evt.text;
@bkiselka
Copy link
Contributor

I think I experience the same problem.

As an example I modified the GetFeatureInfo example injecting the corrupt data that cause the error in IE11. Just click in the map. See pull request #1286

Obviously the not valid HTML5 is can't be read with DomParser() in IE11.
I worked out pull request #1285 as a solution. Is this it?

@ahocevar
Copy link
Member

Fixed with #1439.

@ahocevar ahocevar closed this Mar 25, 2015
bkiselka pushed a commit to bkiselka/ol2 that referenced this pull request Nov 25, 2016
I think I experience the same problem of issue openlayers#1177

As an example I modified the GetFeatureInfo example injecting the corrupt data that cause the error in IE11. Just click in the map.

Obviously the not valid HTML5 is can't be read with DomParser() in IE11.
One solution is pull request openlayers#1285

Another solution may be to check the INFO_FORMAT and do not call
var features = this.format.read(doc);
if it is text/html or text/plain (i.e. not a GML) as in showInfo() just the text is used (no GML features):
document.getElementById('responseText').innerHTML = evt.text;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants