如何从 ionic 3 打开 google chrome 浏览器
How to open google chrome browser from ionic 3
如何从 ionic 3 应用程序打开 google chrome 浏览器?
(本机 android google chrome )并在
中打开 link
安装插件
npm install open-browser -g
将此函数放入您的 .[在此处输入 link 描述][1]ts 文件
根据您的要求设置参数:::::
openWithSystemBrowser(url: string) {
console.log('in system browser');
let target = "_system";
this.InAppBrowser.create(url, target, {
location: 'yes',//Or 'no'
hidden: 'no', //Or 'yes'
clearcache: 'yes',
hideurlbar: 'yes',
clearsessioncache: 'yes',
zoom: 'yes',//Android only ,shows browser zoom controls
hardwareback: 'yes',
mediaPlaybackRequiresUserAction: 'no',
shouldPauseOnSuspend: 'no', //Android only
closebuttoncaption: 'Close', //iOS only
disallowoverscroll: 'no', //iOS only
toolbar: 'yes', //iOS only
enableViewportScale: 'no', //iOS only
allowInlineMediaPlayback: 'no',//iOS only
presentationstyle: 'pagesheet',//iOS only
fullscreen: 'yes',//Windows only
});
}
您可以致电:::::
let Path = 'https://www.google.com/';
this.openWithInAppBrowser(path);
它将在 Chrome 中打开您的 link
但是我在使用系统浏览器时遇到的问题是 URL 不能用其中任何一个选项隐藏...
如果需要,请根据项目安装所需的插件。
如何从 ionic 3 应用程序打开 google chrome 浏览器? (本机 android google chrome )并在
中打开 link安装插件
npm install open-browser -g
将此函数放入您的 .[在此处输入 link 描述][1]ts 文件
根据您的要求设置参数:::::
openWithSystemBrowser(url: string) {
console.log('in system browser');
let target = "_system";
this.InAppBrowser.create(url, target, {
location: 'yes',//Or 'no'
hidden: 'no', //Or 'yes'
clearcache: 'yes',
hideurlbar: 'yes',
clearsessioncache: 'yes',
zoom: 'yes',//Android only ,shows browser zoom controls
hardwareback: 'yes',
mediaPlaybackRequiresUserAction: 'no',
shouldPauseOnSuspend: 'no', //Android only
closebuttoncaption: 'Close', //iOS only
disallowoverscroll: 'no', //iOS only
toolbar: 'yes', //iOS only
enableViewportScale: 'no', //iOS only
allowInlineMediaPlayback: 'no',//iOS only
presentationstyle: 'pagesheet',//iOS only
fullscreen: 'yes',//Windows only
});
}
您可以致电:::::
let Path = 'https://www.google.com/';
this.openWithInAppBrowser(path);
它将在 Chrome 中打开您的 link 但是我在使用系统浏览器时遇到的问题是 URL 不能用其中任何一个选项隐藏... 如果需要,请根据项目安装所需的插件。