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

Ralph S Theart commented on CB-6617:
------------------------------------

close but I think I'm missing something...

{code}
//IAB
<html>
<head>
<link href="../css/inAppBrowser.css" rel="stylesheet" type="text/css">
</head>
        <body onload="urapp.initialize()">
        <h3>Cordova Test</h3>
    <a style="font-size:100px" 
onclick="navigator.notification.alert('boss');">TEST THIS!</a>
    <script type="text/javascript" src="../cordova.js"></script>
        <script type="text/javascript">
    window.onerror = function(message, url, lineNumber) {
                parseUrl = location.search.match(/[^/]+$/g);
                UrlParts = parseUrl[0].split('?');
                FileName = UrlParts[0];
        alert("Error: "+message+" in "+FileName+" at line "+lineNumber);
    }

        var urapp = {
            // Application Constructor
            initialize: function() {
                urapp.bindEvents();
            },
            // Bind Event Listeners
            //
            // Bind any events that are required on startup. Common events are:
            // 'load', 'deviceready', 'offline', and 'online'.
            bindEvents: function() {
                //alert('binding');
                document.addEventListener('deviceready', urapp.onDeviceReady, 
false);
            },
            // deviceready Event Handler
            //
            // The scope of 'this' is the event. In order to call the 
'receivedEvent'
            // function, we must explicity call 'app.receivedEvent(...);'
            onDeviceReady: function() {
                                
                        alert('ready');
            }
    }
        </script>
        </body>
</html>

{code}

alert never gets called even though cordova is loading in the IAB ...you can 
see the pick that shows it.

> inAppBrowser does not contain the localStorage of the parent window
> -------------------------------------------------------------------
>
>                 Key: CB-6617
>                 URL: https://issues.apache.org/jira/browse/CB-6617
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android, iOS, Plugin InAppBrowser
>    Affects Versions: 3.4.0
>            Reporter: Ralph S Theart
>            Assignee: Joe Bowser
>              Labels: android, localstorage
>
> Why is it that I can share localStorage information between wbeviews(I refer 
> to my app and a inappbrowser instance) in iOS but not in Android.
> If I do...
> {code}
> //location: index.html (in my app)
> localStorage.setItem('Cheese':'Brie');
> {code}
> Then if I try to retrieve this data from locally served html file via 
> inappbroweser in android
> {code}
> var item = localStorage.getItem('Cheese');
> item = null
> {code}
> It never get set... BUT if I recompile my app and locally served html file 
> via inAppBroweser then it's there.
> I feel like i'm missing something..
> How in the world are people passing data back and forth between the app view 
> and the iab view?? I need to pass deep objects back and forth ...so using url 
> parameters is unacceptable. Neither is using inject js...as it is not 
> consistent in android ....the data does not always make it to the iab 
> instance and sometimes becomes undefined...I have tested this with LoadStart, 
> LoadStop...it's just not consistent.
> iOS just works...could you help me thanks.



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

Reply via email to