Windows 10 32位上的Edge阻止对本地主机的Ajax调用,出现网络错误0x2efd [英] Edge on Windows 10 32-Bit blocking ajax call to localhost with Network Error 0x2efd

查看:507
本文介绍了Windows 10 32位上的Edge阻止对本地主机的Ajax调用,出现网络错误0x2efd的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个应用程序使用SignalR与本地扫描程序驱动程序进行通信,这些驱动程序已经在IE,Chrome和Firefox上运行了两年,在为SignalR提取集线器js头文件方面没有问题. Edge出现后,我们发现与localhost进行通信时遇到了问题,并且经过长时间的努力寻找一个允许它进行通信的设置(以及许多小时,他们发现没有解决方案的Microsoft票证),我们决定添加标头以允许Edge授予权限.访问域:

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

这似乎可行,但我们几乎没有注意到它适用于64位Windows 10 Edge,但不适用于32位Windows 10 Edge.我花了几个小时来降低所有区域的所有安全性设置并禁用保护模式,尝试使用不同的Ajax技巧来提取文件,但是继续出现错误:

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.

以下伪代码失败:

$.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);
    }
});

我正在寻找对设置的任何见解或要尝试的其他方法,或者是否有其他人看到此问题.另一则信息是,提琴手没有显示该呼叫的任何流量,因此它似乎已被浏览器阻止.同样在出现Edge故障的同一台计算机上-IE,Chrome和FF也会成功.

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.

推荐答案

您的请求缺少以下属性,请添加以下属性即可解决问题.

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

  1. 请求方法:GETPOST
  2. 请求内容类型(标题):application/json
  3. 请求数据类型(标题):jsonXML等.
  1. Request method: GET, POST, etc.
  2. Request content-type (header): application/json, etc.
  3. Request data-type (header): json, XML, etc.

还要查看以下代码段:

type:"POST",
contentType:"application/json; charset=utf-8",
dataType:"json"

这篇关于Windows 10 32位上的Edge阻止对本地主机的Ajax调用,出现网络错误0x2efd的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆