cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joseph Carroll (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-11520) executeScript does not return value on iOS with WKWebView
Date Thu, 30 Jun 2016 23:35:10 GMT

    [ https://issues.apache.org/jira/browse/CB-11520?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15358047#comment-15358047
] 

Joseph Carroll commented on CB-11520:
-------------------------------------

Also, the following never returns a value either:

{code}
        ref.addEventListener('loadstop', function() {
            var interval = setInterval(function() {
                ref.executeScript({
                        code: "'Shh it's a secret!!';" 
                    },
                    function(data) {
                        if (data) {
                            var secretElement = document.getElementById('secret');
                            secretElement.innerText = JSON.stringify(arguments);
                            // ref.close();
                            // clearInterval(interval);
                        }
                    }
                );
            }, 500);
        });
{code}

The difference here is that instead of invoking a function on the page, it should just return
the string 'Shh it's a secret!!'

> executeScript does not return value on iOS with WKWebView
> ---------------------------------------------------------
>
>                 Key: CB-11520
>                 URL: https://issues.apache.org/jira/browse/CB-11520
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugin InAppBrowser, Plugin WKWebViewEngine
>         Environment: iOS
>            Reporter: Joseph Carroll
>
> The following code does not return any value from the `executeScript`
> {code}
>         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);
>         });
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Mime
View raw message