Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-929

Initialize the Cordova in chrome browser

    XMLWordPrintableJSON

Details

    • Wish
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • None
    • None
    • cordova-js

    Description

      I want to be able to fully emulate phonegap in the browser environment so I can easily verify them with selenium.
      The issue is, I cannot figure out a way to properly trigger the initialization (a.k.a channel.onDeviceReady).
      So I'm loading the cordova-js and a mocking library (phonegap-desktop) into the webbrowser, then I call this:

      try

      { cordova.require('cordova/channel').onNativeReady.fire(); }

      catch(e)

      { window._nativeReady = true; }

      but then rather than initialize, Cordova (1.7.0) stops at this line:

      if (!channel.onCordovaInfoReady.fired)

      { utils.alert("ERROR: Attempting to call cordova.exec()" + " before 'deviceready'. Ignoring."); return; }

      which then show an alert dialog and quit.

      Please advice

      Attachments

        Activity

          People

            filmaj Filip Maj
            phuongnd08 Phuong Nguyen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: