Jenia Be Nice Please
Jenia Be Nice Please

Reputation: 2693

cordova in app browser not firing loadstart when href is clicked

inappbrowser only fires the first event when I press a href button.

I'm using cordova inappbrowser like so:

var authWindow = window.open(domain+"/login", '_blank');
$(authWindow).on('loadstart', function(e) {
    console.log("hello world");
}

Then inside the login page, open by the inappbrowser, I have

<a href="subscribe">subscribe</a>

When i press that, the loadstart event is not fired. Also, when I finish the subscription, and the server redirect me, the event is not fired still.

When I login, without pressing the href, inappbrowser does fire the loadstart event when the server does a 302 redirect. It is only after pressing the href that it stop issuing the event.

What can I do to change that?

I need to catch all url changes in the inappbrowser.

Or at least the 302 redirect that the browser issues.

Thanks for your time and kind concern.

jenia

Upvotes: 0

Views: 1104

Answers (2)

Jenia Be Nice Please
Jenia Be Nice Please

Reputation: 2693

it wasnt firing because i didnt set the data-ajax=false on the html element.

Upvotes: 0

AtanuCSE
AtanuCSE

Reputation: 8940

try the addEventListener

authWindow.addEventListener('loadstart', function(event) { alert(event.url); });

Upvotes: 1

Related Questions