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

Conflict between xhr.js from Intel XDK and Weinre remote hook script

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 2.9.0
    • None
    • OS X, Windows

    Description

      I have code that proves a conflict between xhr.js and weinre.

      Cross-post from: https://www.html5dev-software.intel.com/viewtopic.php?f=34&t=5024

      Adding xhr.js causes Weinre to not work, as no connectable targets appear. http://cl.ly/image/1L0l060e381G

      I can confirm that xhr.js and Weinre conflict. If they are both added, neither work. If one is added, and not the other, it works.

      Example:

      <script src="intelxdk.js"></script>
        <script src="xhr.js"></script>
        <script type="text/javascript">
         /* This code is used to run as soon as Intel activates */
         var onDeviceReady=function(){
            //hide splash screen
            intel.xdk.device.hideSplashScreen();
           
           $.get("https://dev-1-web-geo.meteostar.local").done(function(data){ alert(data); });
         };
         document.addEventListener("intel.xdk.device.ready",onDeviceReady,false);
        </script>
      

      Works

      <script src="intelxdk.js"></script>
         <script src="http://debug-software.intel.com/target/target-script-min.js#QhYeZC6N-jY-XBnNnuS5DqN6Ti72PEzRd1Oeu_TKT9g"></script>
        <script src="xhr.js"></script>
        <script type="text/javascript">
         /* This code is used to run as soon as Intel activates */
         var onDeviceReady=function(){
            //hide splash screen
            intel.xdk.device.hideSplashScreen();
           
           $.get("https://dev-1-web-geo.meteostar.local").done(function(data){ alert(data); });
         };
         document.addEventListener("intel.xdk.device.ready",onDeviceReady,false);
        </script>
      

      Doesn't

      It doesn't seem to matter where you put the Weinre script. No matter what, it breaks xhr.js. It broke when included both before and after the xhr.js include.

      To me, this is critical because I would like to use Weinre to debug and test while using xhr.js to enable cross-origin XHRs to the app.

      This seems to affect Weinre 2.0.0-pre-HHOSN197, if that's the correct version number.

      Attachments

        Activity

          People

            Unassigned Unassigned
            jsilverman Jonathan Silverman
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: