Ionic应用内浏览器在其他浏览器中打开url



我需要在应用程序中打开网站,而不是在其他浏览器中,但它总是在谷歌chrome应用程序中开放。

constructor(private iab: InAppBrowser) {
const options: InAppBrowserOptions = {
zoom: 'no',
fullscreen: "yes",
hidenavigationbuttons: "no",
toolbar:'no',
hideurlbar: 'yes',
}

const browser = this.iab.create('https://surveyor.igiinsurance.com.pk/', '_blank',{ toolbar: 'no',  hideurlbar: 'yes',
fullscreen: "yes",location:"no", options});
browser.show(); 
}
}

在平台准备就绪后尝试使用它。

constructor(public platform: Platform, private iab: InAppBrowser) {
const options: InAppBrowserOptions = {
zoom: 'no',
fullscreen: "yes",
hidenavigationbuttons: "no",
toolbar:'no',
hideurlbar: 'yes',
}
this.platform.ready().then( () => {
const browser = this.iab.create("https://surveyor.igiinsurance.com.pk", '_self',{ toolbar: 'no',  hideurlbar: 'yes',
fullscreen: "yes",location:"no", options});
})
}

代码已测试:(

最新更新