Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49268

"load start" event failed when returning from external browser to in app browser

$
0
0

@chris93 wrote:

Hi guys ! i wrapped a site and there are external links which i made to to open outside the in-app browser,I linked it to open in system browser but when I return to in-app browser and again try to open the external links it doesn’t open. It looks like the 'loadstart" occurs only once.

export class HomePage {
constructor(public navCtrl: NavController, private iab: InAppBrowser, public platform: Platform, 
private fileOpener: FileOpener, private transfer: FileTransfer, private file: File, private diagnostic: 
Diagnostic) {
platform.ready().then(() => {
  const browser = this.iab.create('https://www.tutorialspoint.com/ionic/index.htm','_blank', 
 {zoom:'yes',location:'no', clearcache: 'yes', clearsessioncache: 'yes'});
  browser.show();
  browser.on('loadstart').subscribe(
    (data) => {
      console.log("URL IS", data.url);
      this.downloadfile(data.url)
    },
    err => {
      console.log("InAppBrowser Loadstop Event Error: " + err);
    }
  );
 });
 }
 downloadfile(url) {

  var externalCheck = (!url.includes("tutorial.points"));
  var pdfCheck = (url.substr(url.length - 4) == '.pdf');

  if (externalCheck || pdfCheck) {
   window.open(url, "_system", 'location=no');

  }
 }

Is there any solution for this ? any help is really appreciated

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49268

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>