title: Cordova inappbrowser deviceready never fires
body: <p>I have a cordova project and i need to use the inappbrowser plugin to open a window with a cordova page inside while the "parent" still runs.</p>
  
  <p>Cordova loads <code>index.html</code> which opens <code>frame.html</code> using the inappbrowser plugin.<br>
  Cordova get's loaded into <code>frame.html</code> but the deviceready event never fires and after 5 seconds i get this error in the console of <code>frame.html</code>.</p>
  
  <p><b><em>This only happens inside the second webview that is opened using the inappbrowser plugin.</em></b></p>
  
  <h2>Error :</h2>
  
  <pre><code>cordova.js:1183 deviceready has not fired after 5 seconds.
  cordova.js:1176 Channel not fired: onFileSystemPathsReady
  cordova.js:1176 Channel not fired: onCordovaInfoReady
  </code></pre>
  
  <p>I searched a lot and i concluded that it is not an excess of plugins or code in the document's onload that delays the onNativeReady event that is required to fire deviceready.<br>
  When i remove <code>cordova-plugin-file</code> and <code>cordova-plugin-file-transfer</code> the <code>onFileSystemPathsReady</code> error disappears.
  If i remove <code>cordova-plugin-device</code> the <code>onCordovaInfoReady</code> error disappears.</p>
  
  <p>But i need those plugins.<br>
  <strong>What is causing the deviceready event to not fire at all?<br>
  And what can i do to get it to fire without removing the plugins i need?</strong></p>
  
  <h2>Project info :</h2>
  
  <pre><code>Node version: v4.2.2
  Cordova version: 5.4.1
  
  Installed platforms:
      android 4.1.1
      ios 3.9.2
  
  Installed plugins:
      cordova-plugin-bluetoothle 2.4.0 "Bluetooth LE"
      cordova-plugin-device 1.1.0 "Device"
      cordova-plugin-dialogs 1.2.0 "Notification"
      cordova-plugin-file 3.0.0 "File"
      cordova-plugin-file-transfer 1.4.0 "File Transfer"
      cordova-plugin-inappbrowser 1.1.0 "InAppBrowser"
      cordova-plugin-vibration 2.0.0 "Vibration"
      cordova-plugin-whitelist 1.2.0 "Whitelist"
      de.appplant.cordova.plugin.background-mode 0.6.4 "BackgroundMode"  
  
  Config.xml file:
  &lt;?xml version='1.0' encoding='utf-8'?&gt;
  &lt;widget id="com.test.app" version="0.0.1" xmlns="http://www.w3.org/ns/widgets"&gt;
      &lt;name&gt;TestApp&lt;/name&gt;
      &lt;description&gt;
          A sample Apache Cordova application that responds to the deviceready event.
      &lt;/description&gt;
      &lt;author email="dev@cordova.apache.org" href="http://cordova.io"&gt;
          Apache Cordova Team
      &lt;/author&gt;
      &lt;content src="index.html" /&gt;
      &lt;plugin name="cordova-plugin-whitelist" spec="1" /&gt;
      &lt;access origin="*" /&gt;
      &lt;allow-intent href="http://*/*" /&gt;
      &lt;allow-intent href="https://*/*" /&gt;
      &lt;allow-intent href="tel:*" /&gt;
      &lt;allow-intent href="sms:*" /&gt;
      &lt;allow-intent href="mailto:*" /&gt;
      &lt;allow-intent href="geo:*" /&gt;
      &lt;allow-navigation href="http://*/*" /&gt;
      &lt;platform name="android"&gt;
          &lt;allow-intent href="market:*" /&gt;
      &lt;/platform&gt;
      &lt;platform name="ios"&gt;
          &lt;allow-intent href="itms:*" /&gt;
          &lt;allow-intent href="itms-apps:*" /&gt;
      &lt;/platform&gt;
  &lt;/widget&gt;
  </code></pre>
  
  <h3>index.html :</h3>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html &gt;
      &lt;head &gt;
          &lt;meta http-equiv="Content-Security-Policy" content="default-src * data: gap: https://ssl.gstatic.com 'unsafe-eval' 'unsafe-inline';" &gt;
          &lt;meta name="format-detection" content="telephone=no" &gt;
          &lt;meta name="msapplication-tap-highlight" content="no" &gt;
          &lt;meta name="viewport" content="user-scalable=no, initial-scale=1, height=device-height, width=device-width" &gt;
          &lt;title &gt;Index&lt;/title &gt;
          &lt;script &gt;
              document.addEventListener( 'deviceready', function ()
              {
                  console.log( 'ready' );
                  win = window.open( 'frame.html', '_blank', 'location=no', function()
                  {
                      console.log( arguments );
                  } );
              }, false );
          &lt;/script &gt;
      &lt;/head &gt;
      &lt;body &gt;
          &lt;script type="text/javascript" src="cordova.js" &gt;&lt;/script &gt;
      &lt;/body &gt;
  &lt;/html &gt;
  </code></pre>
  
  <h3>frame.html :</h3>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html &gt;
      &lt;head &gt;
          &lt;meta http-equiv="Content-Security-Policy" content="default-src * data: gap: https://ssl.gstatic.com 'unsafe-eval' 'unsafe-inline';" &gt;
          &lt;meta name="format-detection" content="telephone=no" &gt;
          &lt;meta name="msapplication-tap-highlight" content="no" &gt;
          &lt;meta name="viewport" content="user-scalable=no, initial-scale=1, height=device-height, width=device-width" &gt;
          &lt;title &gt;Frame&lt;/title &gt;
          &lt;script &gt;
              window.addEventListener( 'deviceready', function()
              {
                  console.log( 'window.deviceready', arguments );
              }, false );
              document.addEventListener( 'deviceready', function()
              {
                  console.log( 'document.deviceready', arguments );
              }, false );
          &lt;/script &gt;
      &lt;/head &gt;
      &lt;body &gt;
          &lt;script type="text/javascript" src="cordova.js" &gt;&lt;/script &gt;
      &lt;/body &gt;
  &lt;/html &gt;
  </code></pre>
  
  <p><strong>Update :</strong></p>
  
  <p>I am using two self-modified plugins (not the ones that cause the problem), maybe that this is somehow related:</p>
  
  <ul>
  <li><a href="https://github.com/cvuser0/BluetoothLE/tree/custom" rel="nofollow">BluetoothLE</a></li>
  <li><a href="https://github.com/cvuser0/cordova-plugin-background-mode" rel="nofollow">BackgroundMode</a></li>
  </ul>
  
  <h2>Edit :</h2>
  
  <p>I need to use the inappbrowser plugin because the bluetoothle plugin has to keep the connection while navigating through the app in the other frame.
  The frames also need to be able to communicate with eachother and both have access to cordova libraries.</p>
  
  <p>If someone has other ideas how to do this, i'm open for them.</p>
  
  <h3>Update :</h3>
  
  <p>I'm looking into cl.kunder.webview<a href="https://github.com/kunder-lab/cl.kunder.webview" rel="nofollow">https://github.com/kunder-lab/cl.kunder.webview</a> plugin</p>