2

I'm attempting to port a Chrome extension to Edge. The Chrome extension works fine, and all HTTP requests are working as expected. When these same requests fire in the port, I get this error:

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

This issue seems to pop up for a lot of Microsoft stuff, including Windows Phone. Maybe there is a similar answer to my issue for this extension, but I'm permitting ALL URLs in my manifest...

This is the request:

$http.get(url)
    .then(function () {

    })
    .catch(function () {
        var args = arguments;
    });

I've also tried the jQuery way:

$.ajax({
    url: url,
    success: function () {

    },
    error: function () {
        var args = arguments;
    }
});

I can't share the exact URL because it is part of our business architecture, but the Chrome extension consumes it just fine. If I open the URL directly in a browser (Edge or Chrome) it shows the result just fine... I'm at a loss. I know the error means the request can't connect, but why? And how do I fix it?

Community
  • 1
  • 1
jmarkyston
  • 77
  • 8
  • Where in your extension is this being called? Also, try [fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch). – Daniel Herr Oct 06 '16 at 22:27
  • _"I can't share the exact URL because it is part of our business architecture"_ Can you at least confirm it's an intranet address? – Xan Oct 07 '16 at 11:44
  • It is definitely not an intranet address. I tried accessing this from home and it still fails, so it doesn't seem to be a network thing. – jmarkyston Oct 07 '16 at 14:54
  • Also, this is all happening from the background. Interestingly, a similar XML request to the same server succeeds. – jmarkyston Oct 07 '16 at 14:55
  • @DanielHerr I tried using fetch. I'm only getting into the catch block though :( – jmarkyston Oct 07 '16 at 15:19

1 Answers1

2

Seems to be a known bug that hasn't been fully triaged as of 2016-10-07.

In another bug report Microsoft mysteriously says "This is by design as extensions don’t support loopback" and closed it as such. That would certainly be an incompatibility with the Chrome model.

The symptom seems to be that connections to sites that are considered part of the Local Intranet by Windows network stack are denied as part of an aggressive XSS prevention policy.

There is definitely nothing you can do on the extension side until this is resolved by MS. If anything, extension code needs to be privileged enough to do this, even if that breaks their compartmentalization model.

It's possible that you can do some environment changes though. I would experiment with Internet Options for "Local intranet" zone, for example setting Protected Mode on, disabling that for Internet zone, or more likely somehow making sure the site isn't considered intranet. A domain name instead of an IP address may also help "fooling" Edge that it's not intranet.

Xan
  • 74,770
  • 16
  • 179
  • 206
  • Thank you very much for the response! I'll play around with internet settings. I'm definitely using a domain and not an IP for the URL. I'm not sure if that server is on-site or not. Maybe I'll try installing it from home and see what happens. – jmarkyston Oct 07 '16 at 14:21
  • Just an update: I tried this from home an it still fails, and I'm not connected to a VPN, so I don't think this has anything to do with intranet requests. – jmarkyston Oct 07 '16 at 15:25
  • Can it be a self-signed / not deafult-trusted SSL cert? – Xan Oct 07 '16 at 15:27
  • In any case: this may be important for triage. You should add your experiences to the first bug in question. – Xan Oct 07 '16 at 15:28
  • it looks like this is, indeed a loopback issue. When I hit an external API that isn't using loopbacks, my request works. Also, if I hit the same URL I'm trying in this issue in our production environment, it works fine... I'll try and keep an eye on this and if I find new information I'll post it in my question. – jmarkyston Oct 10 '16 at 15:47