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

executeScript does not return value on iOS

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None
    • Environment:

      iOS, cordova-plugin-wkwebview-engine

      Description

      The following code does not return any value from the `executeScript`

              var ref = cordova.InAppBrowser.open('http://some-auth-page', '_blank', 'toolbar=no');
              ref.addEventListener('loadstop', function() {
                  var interval = setInterval(function() {
                      ref.executeScript({
                              code: "$ads.secret.parseToken();" 
                          },
                          function(data) {
                              if (data) {
                                  var secretElement = document.getElementById('secret');
                                  secretElement.innerText = JSON.stringify(arguments);
                                  ref.close();
                                  clearInterval(interval);
                              }
                          }
                      );
                  }, 500);
              });
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jdsalingerjr Joseph Carroll
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: