Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Switch out of private mode when app is removed from memory #4780

Closed
sblatz opened this issue Aug 16, 2019 · 28 comments
Closed

Switch out of private mode when app is removed from memory #4780

sblatz opened this issue Aug 16, 2019 · 28 comments
Assignees
Labels
E3 Estimation Point: average, 2 - 3 days eng:qa:verified QA Verified Feature:PrivateBrowsing
Milestone

Comments

@sblatz
Copy link
Contributor

sblatz commented Aug 16, 2019

I'm opening this in response to #4773.

Currently it is expected behavior that we persist private mode when the app is paused. With the introduction of our "launch in private browsing" feature we should consider if we want to keep this behavior.

@AmyYLee commented on that PR:

@rushsteve1 We are in the process of implementing a private mode launcher shortcut option on homescreen. If the concern here is not wanting someone to know that you were in private browsing mode from Firefox Preview, having a separate launcher for private browsing mode allows the user to separate their public browsing vs. private browsing activities with a separate launcher. Hope this solves your issue.

Of note: our "normal" launcher will still launch in private mode if that's where the user left it, so I don't think it actually solves that case. We should just decide if we want this functionality.

┆Issue is synchronized with this Jira Task

@sblatz sblatz added feature request 🌟 New functionality and improvements Feature:PrivateBrowsing labels Aug 16, 2019
@sblatz sblatz changed the title [Bug] Consider switching out of private mode when app is backgrounded Consider switching out of private mode when app is backgrounded Aug 16, 2019
@AmyYLee
Copy link
Collaborator

AmyYLee commented Aug 22, 2019

@sblatz Hi, with the introduction of PBM launcher I think we should modify the behaviour for when Firefox Preview is set in the background (swiped up off the screen). Right now, if the user was last in PBM with tabs opened and backgrounds the app, the private tabs are cleared but it is still set in PBM. The new behaviour would be when the app is in the background in PBM, upon opening the app again, it will default back to non-private browsing mode. Let me know if you have any questions
2019_08_19__15_23_27_011_0

@AmyYLee AmyYLee added the eng:ready Ready for engineering label Aug 22, 2019
@rushsteve1
Copy link

I apologize for not making this issue myself, and for the slightly late reply.

@AmyYLee Yes! This is exactly the functionality I was suggesting and the change is completed, in a basic manner, but the PR that I opened that started all this #4773.

@rushsteve1
Copy link

Following up on this since I has been a while. Has any decisions been made on this issue?

@sblatz
Copy link
Contributor Author

sblatz commented Sep 4, 2019

@rushsteve1 I will bring this up in our next triage meeting since we are adding the ability to launch in default private mode soon :)

@boek boek added this to To be Triaged in Fenix Sprint Kanban via automation Sep 17, 2019
@boek boek moved this from To be Triaged to In Design Review in Fenix Sprint Kanban Sep 17, 2019
@boek boek moved this from In Design Review to Prioritized Feature Backlog in Fenix Sprint Kanban Sep 17, 2019
@vesta0 vesta0 changed the title Consider switching out of private mode when app is backgrounded Switch out of private mode when app is backgrounded Sep 17, 2019
@vesta0 vesta0 removed the feature request 🌟 New functionality and improvements label Sep 17, 2019
@vesta0
Copy link
Collaborator

vesta0 commented Sep 17, 2019

@sblatz does switching out of private mode mean that users will lose their private tabs?

@sblatz
Copy link
Contributor Author

sblatz commented Sep 17, 2019

@vesta0 No, it'd be equivalent to pressing the mask icon to switch back to normal browsing :)

@vesta0
Copy link
Collaborator

vesta0 commented Sep 17, 2019

@sblatz great, thanks for confirming 👍

@sblatz
Copy link
Contributor Author

sblatz commented Sep 19, 2019

To clarify: should we only show "normal mode" if the private mode tabs have been cleared (by the user force quitting the app or the system killing our process)? Or should it always show normal mode?

@AmyYLee

@rushsteve1
Copy link

In my patch at least, and in the main version of Firefox Android, it only switches back to Normal mode when the app is killed and the private mode tabs are destroyed.

I personally think that this is better UX, since applications that haven't been quit are thought of as still being in-use. Also it would be very counter-intuitive to switch modes while retaining the private tabs.

@sblatz
Copy link
Contributor Author

sblatz commented Sep 20, 2019

@rushsteve1 https://github.com/mozilla-mobile/fenix/pull/4773/files would get us most of the way there but we'd need to make sure to not switch to normal mode if the user launched with the private browsing shortcut or has "always open links in private mode" enabled.

@rushsteve1
Copy link

That should be a simple matter of replacing the

setPrivateModeI(false)

with (I don't know the actual variables but the idea should be obvious)

setPrivateMode(privateBrowsingShortcut || alwaysOpenInPrivate)

@bifleming bifleming added the E3 Estimation Point: average, 2 - 3 days label Sep 23, 2019
@sblatz sblatz changed the title Switch out of private mode when app is backgrounded Switch out of private mode when app is removed from memory Sep 23, 2019
@severinrudie severinrudie self-assigned this Sep 26, 2019
severinrudie added a commit to severinrudie/fenix that referenced this issue Sep 26, 2019
severinrudie added a commit to severinrudie/fenix that referenced this issue Sep 26, 2019
@sblatz sblatz added this to the v2.2 milestone Oct 3, 2019
@sblatz sblatz moved this from In Dev Review to Ready for QA in Fenix Sprint Kanban Oct 3, 2019
@sv-ohorvath
Copy link
Contributor

sv-ohorvath commented Oct 4, 2019

@sblatz Verified on latest Nightly 10/4 and found one issue: The default launcher (of normal browsing) keeps opening in PBM (where it was left) when the "Open links in private mode" setting is checked.

@sv-ohorvath sv-ohorvath removed the eng:qa:needed QA Needed label Oct 4, 2019
@project-bot project-bot bot moved this from Ready for QA to In Progress in Fenix Sprint Kanban Oct 4, 2019
@severinrudie
Copy link
Contributor

Thanks @sv-ohorvath, I'll work on a fix.

severinrudie added a commit to severinrudie/fenix that referenced this issue Oct 7, 2019
… status

This didn't function when 'open links in a private tab' was set.  Rather than adding another sketchy fix for the edge case, following commits will change `usePrivateMode` to be maintained in memory, instead of in Settings.
@severinrudie severinrudie moved this from In Progress to In Dev Review in Fenix Sprint Kanban Oct 7, 2019
ekager pushed a commit that referenced this issue Oct 8, 2019
This didn't function when 'open links in a private tab' was set.  Rather than adding another sketchy fix for the edge case, following commits will change `usePrivateMode` to be maintained in memory, instead of in Settings.
@severinrudie severinrudie moved this from In Dev Review to Ready for QA in Fenix Sprint Kanban Oct 8, 2019
@sv-ohorvath
Copy link
Contributor

Verified as fixed on Nightly 10/9.

Fenix Sprint Kanban automation moved this from Ready for QA to Sprint 10.1 Done Oct 9, 2019
@sv-ohorvath sv-ohorvath added the eng:qa:verified QA Verified label Oct 9, 2019
@klint
Copy link

klint commented Oct 9, 2019

Hi. I have opened a feature request #5883 to provide a way to open Fenix in normal mode in all cases, even if Fenix was previously used in PBM and has not been removed from the memory yet.
Maybe it's only me and maybe I'm not understanding the design, but I must confess I'm rather lost in the transitions between PBM and normal modes :) IMHO, these modes should actually behave like 2 different browsers (with a few bridges), but they do not fully...

@severinrudie
Copy link
Contributor

Hi. I have opened a feature request #5883 to provide a way to open Fenix in normal mode in all cases, even if Fenix was previously used in PBM and has not been removed from the memory yet.
Maybe it's only me and maybe I'm not understanding the design, but I must confess I'm rather lost in the transitions between PBM and normal modes :) IMHO, these modes should actually behave like 2 different browsers (with a few bridges), but they do not fully...

Thank you for opening the feature request! We look at every new request, but we're a little backed up atm and it's taking us a while to get through to them. FWIW, I think there's currently a lot of discussion around private mode with different options being discussed. I'm not sure what we'll eventually land on, but the behavior in this PR won't necessarily be final.

@klint
Copy link

klint commented Oct 17, 2019

@baron-severin Thanks a lot for the clarification. Looking forward to what's next :)

@opusforlife2
Copy link

Hi. I was thinking of opening a new issue but I found this in milestones.

The previous behavior was fine for me. I use desktop Firefox in private browsing mode permanently, and the Fenix toggle replicated that functionality on Android. With this feature gone, I have to open Fenix, switch to private browsing each time, and then continue.

Can there be a toggle to use private browsing permanently, just like desktop Firefox?

@cadeyrn
Copy link
Contributor

cadeyrn commented Oct 19, 2019

@opusforlife2: You can add a private shortcut to your home screen. You find the option to add the shortcut on the settings screen.

@sblatz
Copy link
Contributor Author

sblatz commented Oct 21, 2019

@opusforlife2 if you go to “set as default browser” in Fenix’s settings and enable “open links in private mode” as well as adding the private mode shortcut to your home screen you will effectively have an “always private mode” browser like on desktop :)

Let me know if this doesn’t cover your use case.

@opusforlife2
Copy link

@sblatz One minor nitpick with the current behavior: When you open Fenix using the private browsing shortcut, it takes you straight to the address bar in private browsing mode, but if you tap back, it switches to non private browsing.

But in general, I would prefer the private browsing shortcut to open Fenix not to the address bar with the keyboard automatically popping up, but to the home screen, like it normally does with the default launcher icon.

For complete feature parity with desktop Firefox, though, I would like a setting which makes it impossible to exit private browsing mode unless that setting is turned off.

@sblatz
Copy link
Contributor Author

sblatz commented Oct 30, 2019

@opusforlife2 can you please file a separate issue for that and tag me on it? :)

@opusforlife2
Copy link

@sblatz Done!

@DatGrey
Copy link

DatGrey commented Feb 28, 2020

@sblatz Verified on latest Nightly 10/4 and found one issue: The default launcher (of normal browsing) keeps opening in PBM (where it was left) when the "Open links in private mode" setting is checked.

I'm still having this issue, can someone please confirm I'm not the only one? Thanks.

@sv-ohorvath
Copy link
Contributor

@DatGrey this is now expected. More details here: #7577

@DatGrey
Copy link

DatGrey commented Feb 28, 2020

@sv-ohorvath thanks, I'm not sure I understand the reasoning behind it though... Wouldn't it be more logical for the browser to switch back to normal mode if there's no private tabs open anymore? Or just use whatever was the last used mode, ignoring links/custom tabs? Having different shortcuts (default/private mode) makes no sense otherwise, since simply turning on the "Open links in private mode" option overrides the default/private shortcut behavior.

Maybe I'm just misusing the "Open links in private mode" option? I thought its use was to not "pollute" the browser history with random links openend from different apps (WhatsApp, Reddit, etc), keeping them separated from normal browsing, but right now the option is not affecting only links... the current behaviour is more similar to "Always use private mode" than "Open links in private mode".

Edit: Maybe I should add a more direct example.
Step 1: I have some tabs open in normal mode, some I'm done with, some are open for later.
Step 2: Background the app.
Step 3: Receive a link, open it with "Open links in private mode" active, close it with the "X" or "Back" button.
Step 4: Open Firefox again to go back to the previously opened tabs. This isn't working because the browser opens in private mode.

@sv-ohorvath
Copy link
Contributor

@DatGrey
"Open links in private mode"'s only function is to always open external links and homescreen page shortcuts in private, no matter on which browsing mode you are on.

The browser then keeps as default the mode which was last used when is backgrounded or killed (swiped out of recent tasks) - this functions independent of "Open links in private mode"
So if you opened a link in private, then minimize, or kill the app, reopen it, it will keep private mode on (even with no tabs).
If you switch back to normal browsing before, then it will open normal browsing on restart.

I hope this makes sense.
Also please make sure to update to the latest version of Nightly.

@DatGrey
Copy link

DatGrey commented Feb 28, 2020

@sv-ohorvath thanks for your patience, I've just realized (thanks to your explanation) that the issue I've been seeing happens only when opening links with Firefox in "Chrome Custom tabs" mode - everything works fine using Firefox normally, which I'm doing now.
I'm gonna check if that particular issue has already been reported and report it myself if needed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
E3 Estimation Point: average, 2 - 3 days eng:qa:verified QA Verified Feature:PrivateBrowsing
Projects
None yet
Development

No branches or pull requests