Skip to content
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

(7_3_X) [TIMOB-26325] Android: Ti.UI.WebView not firing events in 7.x #10273

Closed
wants to merge 2 commits into from

Conversation

sgtcoolguy
Copy link
Contributor

JIRA: https://jira.appcelerator.org/browse/TIMOB-26325

Description:
This reverts the boolean flag hack to prevent multiple load/beforeLoad events getting fired when changing the userAgent after construction.

When running through processProperties we set the user agent string before loading the html/url/data content to avoid immediate reload.

I think so long as you provide the user agent in the construction properties this should only ever fire the load/beforeLoad events once. If you construct a WebView with an Url and then change the user agent after (mid-load), it's entirely possible you'll get multiple load/beforeLoad events fired based on the timing of the code.

I included a quick blurb in the Ti.UI.WebView.userAgent apidocs about this behavior.

@build
Copy link
Contributor

build commented Aug 21, 2018

Messages
📖

👍 Hey!, You deleted more code than you added. That's awesome!

📖

💾 Here's the generated SDK zipfile.

Generated by 🚫 dangerJS

Copy link
Contributor

@garymathews garymathews left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CR: PASS
FT: PASS

@@ -635,6 +635,10 @@ properties:
description: |
On the iOS platform, this is not per-webview. Once you have set this property for a webview
it will not change for same. But while creating new webview it can be changed to new user agent.

On Android, changing the user agent after the webview has begun loading content may cause
the webview to reload and fire multiple `load` or `beforeLoad` events. Developers should provide the
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is beforeload.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the catch Hans!

@sgtcoolguy
Copy link
Contributor Author

Merged manually.

@sgtcoolguy sgtcoolguy closed this Aug 21, 2018
@sgtcoolguy sgtcoolguy deleted the TIMOB-26325 branch August 21, 2018 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants