android - Apache Cordova 允许导航被允许 Intent 覆盖

标签 android ios cordova whitelist apache-cordova

我们希望应用程序上的每个链接都能够在系统的外部浏览器中打开,但主机名选择除外。

我们试着把 <allow-navigation href="*.hostname.com/*"/> , 但当您使用 <allow-intent href="http://*/*" /> and <allow-intent href="https://*/*" 时,这会被覆盖作为应用程序中所有其他链接的 Intent 标签。

预期的结果是我们的主机名在应用程序中打开,但它们在外部浏览器上打开。

我已尝试查看网上所有最新的文档和帮助,但找不到解决方案的答案。希望你们知道。

编辑:忘记提及我们使用 inappbrowser 插件运行最新的 cordova CLI 和最新的白名单插件。

此致

丹尼尔

最佳答案

尝试更改您的 <allow-* > 对此的标记:

<allow-intent href="*.hostname.com/*"
<allow-navigation href="https://*/*"
<allow-navigation href="http://*/*"
<allow-access href="https://*/*"
<allow-access href="http://*/*"

<allow-navigation>标签用于控制 Cordova webview 本身可以导航到的 url。

看看这个article以便更好地了解 Cordova 的白名单。

关于android - Apache Cordova 允许导航被允许 Intent 覆盖,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37139731/

相关文章:

java - 向 TextView 和低速应用程序插入 49.000 个字符

java - 如何在 TextView 中获取省略号的文本

java - 我怎么知道何时何地调用父类(super class)的重写方法

ios - 在没有 Apple 开发者帐户的情况下将 Apache Cordova 应用程序部署到 iPad

Android Studio Lint - 为 lint 设置 API 级别

ios - 导航栏在动画期间不反射(reflect)新的文本属性到以前的 View Controller

ios - Xcode:libpods.a 是红色的

ios - 用户点击 SearchBar 时如何使 TableView 不透明

javascript - 无法向 Controller angularJs + CordovaJs (TypeScript) 注入(inject)服务

angular - 错误 : exportArchive: No profiles for 'io.ionic.starter' were found