Document for ways to determine the browser is in private mode
Categories
(Firefox for Android :: Privacy, task)
Tracking
()
People
(Reporter: jackyzy823, Unassigned)
References
Details
Currently there're two ways to determine the browser is in private mode or not.
- BrowsingModeManager https://searchfox.org/mozilla-central/search?q=mode.isPrivate&path=mobile%2Fandroid&case=false®exp=false
- selectedTab?.content?.private https://searchfox.org/mozilla-central/search?q=content%3F.private&path=mobile%2Fandroid&case=false®exp=false
In android-compoments
part , we could only use method 2.
In Fenix
part, both are mixed used.
There should be a document to demonstrate the difference between two ways and a guideline for choosing which to use .
Comment 1•1 year ago
|
||
Where would you imagine such a document living?
A basic answer is:
BrowsingModeManager
(to be replaced by the AppStore
in https://bugzilla.mozilla.org/show_bug.cgi?id=1861459) tracks whether the app is in private mode.
selectedTab?.content?.private
tracks whether the selected tab is in private mode.
These two use cases are not necessarily the same.
Reporter | ||
Comment 2•1 year ago
|
||
Where would you imagine such a document living?
Appstore's document of property mode
or BrowsingModeManager 's document?
These two use cases are not necessarily the same.
Yes.
For example . in this case https://searchfox.org/mozilla-central/rev/d7c5387a43bda5163afcb9e65e17c476c6ecf625/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/session/PrivateNotificationService.kt#70 , will BrowsingModeManager
(or AppStore
) be more suitable ?
and here https://searchfox.org/mozilla-central/rev/d7c5387a43bda5163afcb9e65e17c476c6ecf625/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/toolbar/BrowserToolbarView.kt#223
https://searchfox.org/mozilla-central/rev/d7c5387a43bda5163afcb9e65e17c476c6ecf625/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/browser/TabPreview.kt#83
Here https://searchfox.org/mozilla-central/rev/d7c5387a43bda5163afcb9e65e17c476c6ecf625/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/browser/tabstrip/TabStripState.kt#56 use AppStore
primarily and fallback to content?.private
These are mostly related to a global state of private mode for navbar,toolbar.tabstrip which shouldn't depend on current tab's private mode.
Updated•1 year ago
|
Description
•