cordova-plugin-inappbrowser 未打开从 APP 到 IOS 设备默认浏览器的链接
cordova-plugin-inappbrowser not opening links from APP to IOS Device default Browser
搜索了很多,但找不到正确的解决方案。
I am trying to open links from my app to default browser of my IOS device,
但它不起作用。它与我的 android 设备完美配合。
我的插件安装正确,(我可以在我的应用程序的 cordova 插件列表中看到)
以下是我试过的语法:
window.open(this.href, '_system');
window.open(this.href, '_blank', {closebuttoncaption: 'Close', 工具栏: 'yes', 'location=yes'});
window.open(this.href, '_blank', {closebuttoncaption: 'Close', 工具栏: 'yes'});
window.open(this.href, '_system', 'location=yes')
与 cordova.InAppBrowser.open 相同的解决方案,这是起始语法。
以及尝试使用控制器功能
link
$scope.openInExternalBrowser = 函数(路径){
变量选项="closebuttoncaption=Close,toolbar=yes";
如果($ionicPlatform.is('ios') == 真){
window.open(path, '_blank', {'closebuttoncaption': 'Close', 'toolbar':'yes', 'location=yes'});
}其他{
window.open(路径, '_system', 'location=yes');
}
}
所以寻找一些合适的解决方案,这会奏效。
感谢和问候,
索普
我只是将它用于我的项目并确认它有效
cordova.InAppBrowser.open('https://google.com','_self')
最终,经过大量研究和数千次构建,post 帮助我解决了这个问题。
借助 "cordova-plugin-whitelist" 插件。
您需要在 default-src 属性后添加 "gap:",您的 CSP 元数据。
=> default-src 差距:*;
感谢 Whosebug。
搜索了很多,但找不到正确的解决方案。
I am trying to open links from my app to default browser of my IOS device,
但它不起作用。它与我的 android 设备完美配合。
我的插件安装正确,(我可以在我的应用程序的 cordova 插件列表中看到)
以下是我试过的语法:
window.open(this.href, '_system');
window.open(this.href, '_blank', {closebuttoncaption: 'Close', 工具栏: 'yes', 'location=yes'});
window.open(this.href, '_blank', {closebuttoncaption: 'Close', 工具栏: 'yes'});
window.open(this.href, '_system', 'location=yes')
与 cordova.InAppBrowser.open 相同的解决方案,这是起始语法。
以及尝试使用控制器功能
link
$scope.openInExternalBrowser = 函数(路径){
变量选项="closebuttoncaption=Close,toolbar=yes"; 如果($ionicPlatform.is('ios') == 真){
window.open(path, '_blank', {'closebuttoncaption': 'Close', 'toolbar':'yes', 'location=yes'});
}其他{ window.open(路径, '_system', 'location=yes'); } }
所以寻找一些合适的解决方案,这会奏效。
感谢和问候,
索普
我只是将它用于我的项目并确认它有效
cordova.InAppBrowser.open('https://google.com','_self')
最终,经过大量研究和数千次构建,post 帮助我解决了这个问题。
借助 "cordova-plugin-whitelist" 插件。 您需要在 default-src 属性后添加 "gap:",您的 CSP 元数据。 => default-src 差距:*;
感谢 Whosebug。