Prevent browser from refreshing when launching a new intent with no data
When switching from Privacy Browser to another app and back again, Privacy Browser refreshes the page. In some circumstances, for example a login process that requires to receive a code and then enter it means going to email app and back to browser but, the browser refreshes that page and that one time code entry process is broken and has to start over. This makes it impossible to do. I had this frustrating experience many times especially during account signups and account verifications.
#1 Updated by Soren Stoutner 10 months ago
- Subject changed from Option to prevent browser refreshing to Prevent browser from refreshing when the activity is sent to the background and then brought back to the foreground
- Assignee changed from Raven Nine to Soren Stoutner
- Priority changed from 2.x to Next Release
Thanks for the bug report.
There is some logic in the `onRestart()` command that is run when the activity is brought to the foreground that is causing the refresh. This code is designed to apply any changes in settings that may have occurred. But I can limit this code to only run when the app returns from the Settings activity, which will likely fix the problem.
Do you have an example URL that was causing you problems that I can use to test?
#2 Updated by Soren Stoutner 10 months ago
Received the following in an email:
You're welcome, I didnt realise it was a bug. I havent got a particlar URL to give you but I think you'll find it refreshes everytime it is sent to the background and back to forground regardless of which website.I wonder if you might make the progress bar a little bit thicker too, it is difficult to see on a phone screen.
On a different note, I joined redmine so I could post to your issue tracker, I had only ever used github but I noticed redmine appears to have a nice layout, so I was wondering how do you find using redmine and why you might prefer it over github?
#3 Updated by Soren Stoutner 10 months ago
- Status changed from New to Feedback
In my testing I am not able to replicate the problem. On my devices the page does not refresh when switching between apps and no data is lost from fields.
It is possible that there is some problem specific to your device or the URL you were visiting. Can you send me a screenshot of your About → Version?
The progress bar is thinner on older version of Android and thicker on newer versions.
I use Redmine because it is open source and I can host it on my own server. Github is closed source. I chose Redmine over the other open source options because of it does what I need well and was easy to install.
#4 Updated by Soren Stoutner 10 months ago
Raven Nine responded by email:
I attached screenshots, I noticed if I enter text into any website form then leave the browser to use another app and then come back to browser, it refreshes and the text previously entered is lost.
#5 Updated by Soren Stoutner 10 months ago
You have a really old version of WebView (126.96.36.199 vs the current 64.0.3282.137), which is what shipped with KitKat 4.4.2. Likely, if you could update it would resolve the issue. But I don't think that is possible to do on your device.
At some point I am going to have to remove support for KitKat, but I am trying to hold off on that as long as possible.
There are some changes I can make to the code that may have an impact. I have created a debug build. Please test it and let me know if it helps.
The debug builds cannot be installed over the production versions because the signing key is different. Below are links to two copies. One is for the standard version, which is what you currently have installed. To install this would require that you uninstall your version and lose any settings and bookmarks you may have. If that would cause difficulty, you can install the free version, which will show up as a separate app. It is identical to the standard version except for the banner ad across the bottom. You can use it to test and see if these code changes make a difference.
#6 Updated by Raven Nine 10 months ago
I installed the standard version
he same thing happens
Enter text into any web form, search engine etc.
Close out Privacy Browser.
Re-open privacy browser.
Web page is still as I left it, entered text is still there.
A split second later, web page reloads, progress bar shows page reloading.
Previously entered text is gone.
I found a workaround.
Use recent apps button on phone to switch from privacy browser to another app.
Use recent apps button to switch back.
Page does not reload, previously entered text remains in the web form.
#7 Updated by Soren Stoutner 9 months ago
- Subject changed from Prevent browser from refreshing when the activity is sent to the background and then brought back to the foreground to Prevent browser from refreshing when launching a new intent with no data
I misunderstood the original bug report. I had assumed you were using the recent apps button to switch between apps. Now that I understand you were using the launcher icon I am able to replicate this bug on my device.
The root cause is that when the launcher icon is pressed a new intent is created to launch the app. The new intent enters the program through a different set of code. There was a flaw in the logic of this code that always caused the web page to reload. I have changed the code so that the page is only reloaded when the intent contains a new URL (for example, when clicking a link from another app).
This fixes the bug on my device. I have updated the debug build so you can test it as well. The previous link now has the new build.
#8 Updated by Raven Nine 9 months ago
Yes the new build fixed it on my device too thanks Soren! Apologies for not making the bug report more clearly to begin with, I'll try to do better in future.
I have come across other bugs related to the way pages render but I didnt bother you with them because I think they are related to webview.
I would like to update webview but like you said, it doesnt seem possible on my device, bootloader is locked I have been unable to get root.
#10 Updated by Soren Stoutner 9 months ago
- Tracker changed from Feature to Bug
- Status changed from Feedback to Closed