Inconsistent execution of executeScript in Cordova inAppBrowser on iOS
<p>I'm having some trouble with some inAppBrowser behavior in my cordova app. Here's the code:</p>

<pre><code>var codePass = fooCode;
var executeScriptFunc = function(event) { 
  ref.executeScript({
    code: codePass
  }, function (value) {});
  ref.removeEventListener('loadstop', executeScriptFunc);
};

var ref = cordova.InAppBrowser.open(fooObject.link, "_blank", "location=yes,enableViewportScale=yes");
ref.addEventListener('loadstop', executeScriptFunc)
</code></pre>

<p>The strange thing here is that the code works perfectly every time when emulated. It opens the browser and executes the script no problem. But when I try it on my actual iPhone device, it doesn't always work. The script executes maybe every other time. But it's never even that consistent.</p>

<p>Both the emulator and iPhone are using iOS 9.3.4. Any ideas?</p>