title: alert() not displayed from Cordova InAppBrowser event listener - Conflict w/ Cordova window.alert hook
body: <p>Using Cordova CLI version 5.4.1,
  Platform is iOS,
  Running on iOS emulator</p>
  
  <p>From my app's <code>onDeviceReady</code> handler, I am calling a function to set a hook for alerts to be shown using the native dialog as follows:</p>
  
  <pre><code>overrideBrowserAlert: function() {
      if (navigator.notification) { // Override default HTML alert with native dialog
          window.alert = function (message) {
              navigator.notification.alert(
                  message,    // message
                  null,       // callback
                  "MyAppTitle", // title
                  'OK'        // buttonName
              );
          };
      }
  },
  </code></pre>
  
  <p>Most <code>alert</code> calls work, but the following doesn't.</p>
  
  <p>At some stage I am opening an <code>InAppBrowser</code> window. It closes successfully when the "Done" button is clicked. I have registered an event listener for the event <code>exit</code> which does two things:</p>
  
  <ol>
  <li><code>alert("InAppBrowser window closed");</code></li>
  <li><code>Make an AJAX call, get some HTML from a remote server and show it in a &lt;div&gt; element</code></li>
  </ol>
  
  <p>HERE IS THE PROBLEM: The AJAX call is successful, but the <code>alert</code> IS NOT DISPLAYED. This means the <code>exit</code> event is fired successfully and there is a problem with the <code>alert</code> call only.</p>
  
  <p>THE PROBLEM GOES AWAY LIKE THIS: Guessing that it might be a scope or event handling conflict, I commented out the code for the <code>window.alert</code> hook (i.e. the <code>overrideBrowserAlert</code> call above), and sure enough, the alert in the InAppBrowser <code>exit</code> event handler works.</p>
  
  <p><strong>MY QUESTION IS:</strong> Does anyone know how to resolve this conflict so that the alert in the InAppBrowser <code>exit</code> event handler works AND the  <code>window.alert</code> hook is also enabled?</p>
  
  <p>Thanks!</p>