简体   繁体   English

在Excel的嵌入式浏览器中为Windows解锁CORS

[英]Unblock CORS in the embedded browser of Excel for Windows

I'm developing an Excel add-in.我正在开发一个 Excel 加载项。 I need to test the add-in in Excel for Windows in my virtual machine of Mac.我需要在我的Mac虚拟机中测试Excel中的插件Windows。 Therefore, I use <AppDomain>https://192.168.1.1:8000</AppDomain> and eg, <SourceLocation DefaultValue="https://192.168.1.1:8000/#/app" /> in the manifest file.因此,我在清单文件中使用<AppDomain>https://192.168.1.1:8000</AppDomain>和例如<SourceLocation DefaultValue="https://192.168.1.1:8000/#/app" />

I use this add-on in Microsoft Edge in the virtual machine, as a result, the add-in can be run in Excel Online in Edge without problem.我在虚拟机的Microsoft Edge中使用了这个插件,结果在Excel Online in Edge中运行该插件没有问题。

Then I try to run the add-in with the same manifest in Excel for Windows. Then it raises an error Access to XMLHttpRequest at 'https://www.backend.io/...' from origin 'https://192.168.1.1:8000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.然后,我尝试在 Excel 中为 Windows 运行具有相同清单的加载项。然后它引发错误Access to XMLHttpRequest at 'https://www.backend.io/...' from origin 'https://192.168.1.1:8000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

I believe the browser embedded in Excel for Windows is Edge.我相信嵌入 Excel for Windows 的浏览器是 Edge。 I'm surprised that unblocking CORS in Edge does not unblock CORS in Excel for Windows. Is it an expected behavior?我很惊讶在 Edge 中解锁 CORS 并没有为 Windows 解锁 Excel 中的 CORS。这是预期的行为吗?

Does anyone know how we could unblock CORS in the embedded browser of Excel for Windows?有谁知道我们如何在 Excel 的嵌入式浏览器中为 Windows 解锁 CORS?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM