Question

I'm developing an app with Cordova 3.1.0 + inAppBrowswer plugin + js/css injection.

I'd like a feature to record some activity such as scroll-position on the referenced inAppBrowswer, so that the reopened page automatically scrolls to the recorded position.

Is there any way to do that?

Or, somehow webSocket server and client to communicate between phonegap app side and inAppBrowser app side can do the job, but so far I'm not willing to go that deep.

Was it helpful?

Solution

    iab1 = window.open('http://foobar.com', '_blank', 'location=no');
    iab1.addEventListener('loadstop', function(event)
    {
        iab1.executeScript(
        {
            code: " var t = window.localStorage.getItem('test');alert(t);window.localStorage.setItem('test', '9999');"

        }, function()
        {
            alert("done");
        });
    });

ok this test code works as expected.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top