-
Notifications
You must be signed in to change notification settings - Fork 2.2k
(android) Removed waitForBeforeload flag as it prevents beforeLoad from being called on every GET request #755
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
base: master
Are you sure you want to change the base?
Conversation
…o be called for every GET request and it does not seem to have any meaningful use
@wvengen originally implemented the have you got an opinion on this @wvengen? |
We saw it was added on purpose and I believe it may had a specific goal. However, now it has the effect of preventing beforeLoad from being called on every GET request, which is quite a big deal. |
waitForBeforeload is necessary. I think it prevent duplicate event. for fix problem you maybe want correct it instead of remove. I have found same problem before and fixed by correct it when onPageFinished. Real problem is when load error it not reset waitForBeforeload. Could you please check commit? |
We have been using the change in this PR in our app in the Google Play Store for almost two month (500k installs). We have no reports of issues with beforeLoad which is called a lot when the customer uses the app. So, if waitForBeforeload is really necessary, I would expect a completely different situation. By the way, no one has been able to provide a good explanation on why it's needed. On the other hand, if you have in the code, beforeLoad only happens every other request, which is definitely wrong. That has been reported more than once by many people. It would really nice to have an good explanation on why it's necessary. By looking at the code, I cannot really understand it. |
To follow up on this PR, I've found in testing that this PR is necessary for beforeload to function more than once. @stionic: The code for waitForBeforeload doesn't prevent duplicates of the beforeload event occurring and can be safely removed . |
This PR fixes the issues we found too! |
Thank you. This finally fixed this issue for me. |
Platforms affected
Android
Motivation and Context
Resolves #686
Link to the issue: #686
Description
We removed waitForBeforeload flag as it prevents beforeLoad from being called on every GET request and it does not seem to have any meaningful use.
Testing
Testing was done manually as I am not sure how to automate it.
The following tests were executed for Android 7, 8, and 10.
Created a new Cordova test app using cordova-plugin-inappbrowser.
Executed:
cordova.InAppBrowser.open("https://www.hannaford.com", "_blank", "beforeload=get");
and verified beforeLoad gets called with every get request.
Executed:
cordova.InAppBrowser.open("mailto:[email protected]", "_blank", "beforeload=get");
and verified beforeLoad gets called with that get request.
Checklist
(platform)
if this change only applies to one platform (e.g.(android)
)