当前位置:网站首页>uni-app - Refused to display ‘xxx‘ in a frame because an ancestor violates the following Content Sec
uni-app - Refused to display ‘xxx‘ in a frame because an ancestor violates the following Content Sec
2022-07-19 13:15:00 【王佳斌】
报错原因
整体流程的话,就是将网页通过
web-view
组件内嵌到App
中(非小程序),其中有跳转微信公众号的需求,不料却收到了以下报错。
我又不是打包小程序,就套壳个 App
,比较疑惑为什么会报错。
以下报错在 uni-app
内置浏览器中,预览 H5
端时出现:
Refused to display 'https://xxx' in a frame because an ancestor violates the following Content Security Policy directive: "frame-ancestors 'self'
归根结底是 iframe
同源策略问题。
解决方案
注意:仅适用于打包 非小程序端,如果打包小程序端则必须后台配置白名单(这是一定的)。
这是由于 uni-app
内置浏览器的原因,所以才会导致的此问题。
你正常打包成 App 后,是不会有该问题的。
所以,你直接打包就行了,完事后这个报错自己就没有了。
边栏推荐
- Ceres robust curve fitting
- mongodb-探索阶段[通俗易懂]
- 【ARM】新唐NUC977移植WK2124驱动
- Troubleshooting ideas that can solve 80% of faults
- What you have to know about responsive layout
- Study notes - C string delete character
- UVM中uvm_event中带参数的用法
- systemverilog中立即断言和并发断言
- uniapp通过addInterceptor拦截路由跳转,控制页面是否需要登录
- 广州深入开展经营性自建房安全整治“百日行动” 两个月排查房屋逾两百万栋
猜你喜欢
[matlab project practice] invoice recognition based on MATLAB (including GUI interface)
塔望3W消费战略-消费本位研究法:焦点座谈会(Focus Group)
深度详解多链钱包系统开发功能及多币种钱包系统开发原理分析
使用八叉树结构来管理场景
[development of large-scale e-commerce projects] mall business - Search Service - building page environment -47
shell编程(十) : [shell基础] 控制脚本
测试管理工具哪家强?
面试官:3 种缓存更新策略是怎样的?
LIO-SAM:带平滑和建图的紧耦合激光惯性里程计
Almost died suddenly! An employee of an Internet company in Hangzhou was sent to ICU ward for myocarditis after staying up late and working overtime continuously. The company: she worked overtime volu
随机推荐
PLC-LiSLAM线-面-圆柱体-激光SLAM
Era journey of operators: plant 5.5G magic beans and climb the Digital Sky Garden
Ceres计算Bundle Adjustment
Linux 编译安装redis 离线
Introduction to hotspot virtual machine
[matlab project practice] invoice recognition based on MATLAB (including GUI interface)
Ceres鲁棒的曲线拟合
UVM中set/get_config_int/string/object与uvm_cofig_int/string/object的使用
Ceres解析求导
【LSTM回归预测】基于matlab attention机制LSTM时间序列回归预测【含Matlab源码 1992期】
UVM中的phase机制
万字长文,一文讲透!终于有人把商业智能(BI)讲清楚了
Redis 分布式锁的实现
golang 接口变量的赋值和方法的调用
DS(StackAnQueueBasiApplication)
[introduction series of redis] get to know redis and the installation of redis
MySQL八股文,备战金九银十
DS(ArrayStructure)
RISC-V MCU 物联网智能外卖柜
关于不同版本的SQLSERVER数据库性能问题