title: Cordova InAppBrowser EventListeners not working on ios
body: <p>When run on the iphone 7 device or emulator, inappbrowser successfully opens, but the eventlisteners are never called. The code below works fine on android.
  I am working on cordova 6.5.0 and the inappbrowser plugin is version 1.6.1. I am currently working on mac osx 10.12.2.</p>
  
  <pre><code>function redirect () {
    if (isloggedin){
      navigator.notification.alert("You are already logged in");
    } else {
      var url = "https://connect.stripe.com/oauth/authorize?response_type=code&amp;client_id=CLIENT_ID&amp;scope=read_write";
      var target = "_system";
      var options = "location=yes, hidden=no, clearcache=yes";
      browserRef.addEventListener('loadstart', function(event) {
        if ((event.url).indexOf("https://example.com") !== -1) {
          var redirectedURI = event.url;
          registerUser(redirectedURI);
          browserRef.close();
        }
      });
    }
  }
  </code></pre>
  
  <p>Here is an image of a navigator notification with <a href="https://i.stack.imgur.com/RKka6.png" rel="nofollow noreferrer">info about browserRef.</a>
  I am more than happy to provide more info such as my config.xml.
  Any help is much appreciated, thanks.</p>
  
  <p>Edit: Whenever I try adding browserRef.close() at the end of my redirect function, I get an error from xcode "IAB.close() called but it was already closed". I've also tried window.open() without any success.</p>
  
  <p>Edit 2: The redirect function is called on click of this button </p>
  
  <pre><code>&lt;a href="#" onClick="redirect();"&gt;Online Payments&lt;/a&gt;
  </code></pre>