Ionic 在应用程序浏览器中打开 url 在其他浏览器中
Ionic in app browser opening url in other browser
我需要在应用程序中打开网站,而不是在其他浏览器中,但它总是在 google 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});
})
}
代码已经过测试:)
我需要在应用程序中打开网站,而不是在其他浏览器中,但它总是在 google 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});
})
}
代码已经过测试:)