-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LoadStarted WebView event doesn't trigger on Android #15
Comments
I adjusted the webview-utils.android.js somewhat with the little knowledge I have about NativeScript. The [onLoadStarted] event triggers at the right time with below code:
|
Not sure why this issue was closed. Can't remember having it closed. Probably mis-clicked. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am using [loadStarted] and [loadFinished] events in a Webview in NativeScript/Angular, among other things, to start and stop a spinner. On my iPhone both events are triggered as soon as navigation starts and ends. On my Android phone the loadStarted event isn't triggered causing the spinner to malfunction. Looks like only links with tel:, mailto: and loc: trigger the [loadStarted] event.
In node module [webview-utils.android.js], function [onPageStarted], line 47 there is this If statement: if (!isHttpRequest || ++this.startEventCount === 1) The ++ increments this.startEventCount while testing === 1 which will only be true the first time a pageLoad starts. In my opinion this causes the loadStarted event to be called only once (unless the url starts with [tel:, mailto: or loc:]) Having fixed this locally, I noticed that the loadStarted event is triggered too late. Showing the spinner only a few milliseconds before the webpage finishes loading.
Non-trigger and too late trigger of [loadStarted] both don't work for my App.
Are there solutions to these problems?
XML:
TypeScript:
Terminal log after tapping some links:
The text was updated successfully, but these errors were encountered: