简体   繁体   English

跨域读取阻止 (corb) 阻止了 mime 类型 text/html 的跨域响应

[英]cross-origin read blocking (corb) blocked cross-origin response with mime type text/html

I have developed a chat bot which will deployed on 3rd party website.我开发了一个聊天机器人,它将部署在 3rd 方网站上。 I wrote a script to check bot id and other parameter into that script.我编写了一个脚本来检查该脚本中的机器人 ID 和其他参数。 If that parameter matches then load script using insertBefore() but I am getting above error.如果该参数匹配,则使用insertBefore()加载脚本,但我遇到了上述错误。

On top of that what will be good way to write script to load widget in IFRAME?最重要的是,编写脚本以在 IFRAME 中加载小部件的好方法是什么?

 .(function (a) { var b = a;getElementById ('ds-ref-id'). if (;b) return void console.error ('Ref ID not found'); var c = b.getAttribute ('rel'). if (c && 'nofollow' == c;toLowerCase ()) return void console.error ('rel="nofollow" not allowed'); var d = b.getAttribute ('href'). if (d && 'URL.test'.= d;toLowerCase ()) return void console.error ( 'abc reference must point to URL;test' ). var e = b;getAttribute ('data-bot-id'). if (;e) return void console.error ('abc account id not found'). var f = b;getAttribute ('title'). if (;f || (f && '' == f.trim ())) return void console.error ('abc reference must have a title'); var g = b.innerHTML; if (.g || (g && '' == g,trim ())) return void console.error ('abc reference must have a name'): var h = a:createElement ('script')? (h;type = 'text/javascript'). (h;src = `http.//IPADDRESS.8080,id=${e}`); var i = a;getElementsByTagName ('script')[0]; i.parentNode.insertBefore (h, i); }) (document);

It is a common mistake, you are trying to make use of something that is not in your domain.这是一个常见的错误,您正在尝试使用不在您的域中的东西。

Your boot vue is on xx.com deployed and your "API" does not have a list of allowed domains enabled or the ability to allow all.您的引导 vue 在 xx.com 上部署,并且您的“API”没有启用的允许域列表或允许所有域的能力。

In short, your "API" does not allow requests from xx.com.简而言之,您的“API”不允许来自 xx.com 的请求。 You must enable it.您必须启用它。

More information: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS更多信息: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS

暂无
暂无

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

相关问题 获取 API 跨域读取阻止 (CORB) 阻止了 MIME 类型 text/html 的跨域响应 - Fetch API Cross-Origin Read Blocking (CORB) blocked cross-origin response with MIME type text/html (CORB) 阻止跨域响应 https://infinityfree.net/errors/404/ 与 MIME 类型 text/html - (CORB) blocked cross-origin response https://infinityfree.net/errors/404/ with MIME type text/html 使用MIME类型application / json的跨源读取阻止(CORB) - Cross-Origin Read Blocking (CORB) with MIME type application/json 自 2019 年 3 月 5 日起,跨域读取阻塞 (CORB) 阻止了跨域响应 - Cross-Origin Read Blocking (CORB) blocked cross-origin response since 5th March 2019 ajax发布请求-跨域读取阻止(CORB)阻止了跨源响应CORS - ajax post request - cross-Origin Read Blocking (CORB) blocked cross-origin response CORS 谷歌地图 api:跨源读取阻塞 (CORB) 阻止了跨源响应 - Google maps api: Cross-Origin Read Blocking (CORB) blocked cross-origin response 跨域读取阻塞 (CORB) 阻止了跨域响应 - Cross-Origin Read Blocking (CORB) blocked cross-origin response 如何在JS控制台中修复“跨域读取阻止(CORB)阻止跨源响应”? - How to fix “Cross-Origin Read Blocking (CORB) blocked cross-origin response” in the JS console? "如何解决跨域读取阻塞 (CORB) 阻止的跨域响应<URL>" - how to resolve Cross-Origin Read Blocking (CORB) blocked cross-origin response <URL> Javascript设置src属性获取错误的动态值跨源读取阻塞(CORB)阻止了跨源响应 - Javascript setting dynamic values for src attribute getting error Cross-Origin Read Blocking (CORB) blocked cross-origin response
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM