无法在Ionic 3中关闭浏览器

时间:2019-02-12 05:05:51

标签: ionic-framework ionic3

当某些页面开始加载时,我需要关闭InAppBrowser,我的代码:

constructor(private iab: InAppBrowser) {}

const options: InAppBrowserOptions = {
  zoom: 'no',
  hardwareback: 'no',
  location: 'no'
};

const browser = this.iab.create('https://ionicframework.com/', '_self', options);
browser.on('loadstart').subscribe(event => {
  if (event.url === 'https://ionicframework.com/getting-started') {
    console.log('close!');
    browser.close();
  }
});

/ getting-started 页面开始加载时,我在控制台“ close!”中看到了,但是浏览器无法关闭

0 个答案:

没有答案