Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Edge on Windows 10 32-Bit blocking ajax call to localhost with Network Error 0x2efd

We have an app that uses SignalR to talk to scanner drivers locally that has been in production for a couple of years working on IE, Chrome and Firefox, which do not have a problem pulling down the hubs js header file for SignalR. Once Edge came out we saw an issue with talking to localhost and after long efforts of finding a setting to allow it to communicate (and many hours with a Microsoft ticket that they found no solution), we settled on adding headers to allow Edge to grant access to domain:

Access-Control-Allow-Origin: https://localhost:11000

This seemed to work, but little did we notice that it worked for a 64-Bit Windows 10 Edge, but did not on 32-Bit Windows 10 Edge. I have spent hours lowering all security settings for all zones and disabling Protected Mode, trying different ajax tricks to pull the file, but continue to get the error:

SCRIPT7002: XMLHttpRequest: Network Error 0x2efd, Could not complete the operation due to error 00002efd.

The following pseudo code fails:

$.ajax({
    url: "https://localhost:11000/signalr/hubs",
    crossDomain: true,
    success: function (data) {
        console.log("success");
    },
    error: function (jqXHR, textStatus, errorThrown) {
        console.log("error:");
        console.log(jqXHR);
    }
});

I'm looking for any insight into settings or anything else to try, or if anyone else has seen this issue. One other piece of information, fiddler doesn't show any traffic for the call so it is being blocked by the browser it would seem. Also on the same computer that fails with Edge - IE, Chrome and FF will succeed.

like image 546
Steven Edison Avatar asked Jun 16 '16 20:06

Steven Edison


People also ask

Does Microsoft EDGE support Ajax?

Ajax "get" works in Firefox, but not in Microsoft Edge, Opera or Chrome.

How do I enable localhost in edge?

Next, open Edge and enter about:flags in the address bar. Make sure that the "Allow localhost loopback" option is checked, and if not, enable it. Now you should be able to connect to your local server using the Edge browser.

How do I fix EDGE compatibility?

Open the Settings app and click Update & Security > Troubleshoot > Additional troubleshooters. Run the Internet Connections, Program Compatibility Troubleshooter, and Windows Store Apps troubleshooters to scan and automatically fix any problems which could potentially be causing Microsoft Edge problems.


1 Answers

Your request is missing the following attributes, adding which should solve the problem.

  1. Request method: GET, POST, etc.
  2. Request content-type (header): application/json, etc.
  3. Request data-type (header): json, XML, etc.

Also look at the following code snippet:

type:"POST",
contentType:"application/json; charset=utf-8",
dataType:"json"
like image 196
Patt Mehta Avatar answered Oct 05 '22 07:10

Patt Mehta