xcode - 如何将电容器白名单插件添加到离子应用程序
问题描述
使用cordova时,文档清楚地说明了如何将一些url添加到cordova whitlist,以便可以在我的离子应用程序的应用程序浏览器中打开它们。
$ cordova plugin add cordova-plugin-whitelist
$ cordova prepare
and then in the config.xml
<allow-navigation href="http://example.com/*" />
<!-- Wildcards are allowed for the protocol, as a prefix
to the host, or as a suffix to the path -->
但是我没有使用cordova而不是电容器,我找不到任何信息如何使用电容器添加白名单插件以及config.xml在哪里?关于如何去做的任何建议?
解决方案
只需 npm 安装插件,电容器允许所有连接
npm install cordova-plugin-whitelist
npx cap sync
推荐阅读
- rust - 打印!打印一个 2 位整数
- azure - 如何使用 cli 为 Azure 服务总线设置 primaryConnectionString?
- c# - ASP.NET Core 5 - 输出幻像数据的超时中间件?
- dataframe - 将每个项目与数据框中的每个其他项目进行比较
- python - LSTM 连接错误的维度
- cmake - cmake包依赖的最佳实践
- flutter - Flutter multi_image_picker在android上崩溃
- c - 创建二叉搜索树结构并在 C 中正确初始化它
- python - 如何为在 tkinter 中按下创建的按钮的次数创建一个计数器?
- javascript - 安装节点模块“npm install”时出现问题