首页 前端知识 本地vue项目测试iframe嵌入本地页面,虽然ip相同但是端口不一样但是报错The Content Security Policy directive 'frame-ancestors' is ignored when delivered via a element vue.runtime.esm.js:619 [Vue warn]: Error in v-on handler: "SecurityError: Blocked a frame with origin "http://192.168.4

本地vue项目测试iframe嵌入本地页面,虽然ip相同但是端口不一样但是报错The Content Security Policy directive 'frame-ancestors' is ignored when delivered via a element vue.runtime.esm.js:619 [Vue warn]: Error in v-on handler: "SecurityError: Blocked a frame with origin "http://192.168.4

2024-04-19 16:04:34 前端知识 前端哥 367 384 我要收藏
这个问题是因为浏览器的安全策略导致的跨域访问问题。解决方法是在被嵌入页面中添加如下meta标签: ```html ``` 这样就允许访问指定的IP和端口了。如果还有其他IP和端口需要访问,可以按照相同的格式添加到content中。这样就可以解决iframe跨域访问的问题。
转载请注明出处或者链接地址:https://www.qianduange.cn//article/5248.html
标签
评论
发布的文章

用js生成小米商城

2024-04-27 21:04:59

网页汇率计算器vue代码

2024-04-26 13:04:44

Python读写Json文件

2024-04-23 22:04:19

大家推荐的文章
会员中心 联系我 留言建议 回顶部
复制成功!