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.

Était-ce utile?

La 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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top