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

The inAppBrowser acts weirldy

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Incomplete
    • None
    • None
    • None

    Description

      var ref;
      if (device.platform == 'Android')

      { ref = window.open('https://hadaf.pro', '_blank' ,'location=no,toolbar=no'); }

      else

      { ref = window.open('https://hadaf.pro', '_blank' ,'location=no,toolbar=no'); }

      /*
      var ref;
      if (device.platform == 'Android')

      { ref = window.open('http://192.168.1.7:3000', '_self' ,'location=no,toolbar=no'); }

      else

      { ref = window.open('http://192.168.1.7:3000', '_blank' ,'location=no,toolbar=no'); }

      */
      ref.addEventListener( "loadstop", function() {
      ref.executeScript({
      code: "localStorage.setItem('pushnotifId','"regId"'); localStorage.setItem('platform','"device.platform"');"
      //code: "alert('InApp');if (typeof(Storage) !== 'undefined')

      { alert('There is '); }

      else

      { alert('No local storage '); }

      ; localStorage.setItem('pushnotifId','"regId"'); localStorage.setItem('platform','"device.platform"'); alert('LocalStorage'+localStorage.getItem('platform'));"
      },function(data)

      { alert("Code Inserted Succesfully")}

      );
      })

      In android I get "Code Inserted Succesfully" when using _blank in both https://hadaf.pro and the local http://192..., however I get "Code Inserted Succesfully" when using _self only in the http://192.. but not in the https://hadaf.pro

      So basically local storage seems to act weirdly in _self;

      Attachments

        Activity

          People

            Unassigned Unassigned
            Nasser Nasser Alminji
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 72h
                72h
                Remaining:
                Remaining Estimate - 72h
                72h
                Logged:
                Time Spent - Not Specified
                Not Specified