Closed Bug 1639716 Opened 4 years ago Closed 3 years ago

Consider allowing profiling in private browsing sessions

Categories

(DevTools :: Performance Tools (Profiler/Timeline), enhancement, P3)

enhancement

Tracking

(firefox98 fixed)

RESOLVED FIXED
98 Branch
Tracking Status
firefox98 --- fixed

People

(Reporter: Harald, Assigned: julienw)

References

(Blocks 1 open bug)

Details

(Keywords: dev-doc-needed)

Attachments

(12 files)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

Private browsing is a convenient way for profiling as it resets cache/cookies and cuts out addons impact.

The reasoning that PB disables profiling historically is preventing the accidental profiling of private browsing sessions.

I would argue that the obvious risk isn't recording and viewing the profiles in the Profiler – but sharing the data.

With that in mind, more fine-grained mitigation would be to warn/confirm with users when uploading a profile recorded in PB. Ongoing work on single-tab recording combined with the existing sanitization (removal of hidden data) the risk is further mitigated for general audience.

Moving to popup improvements, as this is not part of the design spec.

Blocks: 1566920
No longer blocks: about-profiling

(In reply to :Harald Kirschner :digitarald from comment #0)

The reasoning that PB disables profiling historically is preventing the accidental profiling of private browsing sessions.

I would argue that the obvious risk isn't recording and viewing the profiles in the Profiler – but sharing the data.neral audience.

My impression is that the biggest risk is starting the profiler from a normal window when a Private browsing window that should have remained private was still in the background. I don't think starting the profiler from a private browsing window should be a problem, as long as the user is intentionally doing it.

Considering that the old performance panel works on Private Browsing sessions, and that web developers tend to use this regularly for development, we might want to address this before we enable the new panel by default.

Julien, Honza what do you think?

Flags: needinfo?(odvarko)
Flags: needinfo?(felash)

Yeah I believe we could make it work, but then we should probably record it in the profile metadata and show it in the frontend, especially when the user will share it. I believe there's a small bit of work.

Flags: needinfo?(felash)

Some comments / thoughts:

  • I agree that we should support profiling of Private Browsing sessions
  • The "Share Performance Profile" popup can show a warning when the profile contains data from Private Browsing Sessions
  • [optional] The DevTools Performance panel could show the same (visually similar) warning informing the user that there are Private Browsing sessions running in the backround that will be included in profiling.
  • Should the default settings in the Performance panel be "Web Developer" as opposed to "Firefox Platform"?

Also, the "Web Developer" settings isn't equal to "single-tab recording", correct? Do we have a bug for "single-tab recording"?
It feels like regular DevTools users are mostly interested in debugging the current tab, which automatically excludes any other running browser sessions/tabs.

Flags: needinfo?(odvarko)

The DevTools Performance panel could show the same (visually similar) warning informing the user that there are Private Browsing sessions running in the backround that will be included in profiling.

So from DevTools' perspective, the preferred option is to allow recording sessions with private browsing windows and just display a warning. We'll need some analysis for what needs to be done outside of the simple UI changes in the DevTools panel. Also need to check with other stakeholders that this is an acceptable change.

Should the default settings in the Performance panel be "Web Developer" as opposed to "Firefox Platform"?

Oh good point, we should file a bug for this!

(In reply to Jan Honza Odvarko [:Honza] (always need-info? me) from comment #5)

Also, the "Web Developer" settings isn't equal to "single-tab recording", correct? Do we have a bug for "single-tab recording"?
It feels like regular DevTools users are mostly interested in debugging the current tab, which automatically excludes any other running browser sessions/tabs.

Redirecting the question to Julien. I think it's correct that WebDeveloper differs from single-tab recording, even though by default the "active tab" should be selected in the profile (currently there is a small issue with this, see https://bugzilla.mozilla.org/show_bug.cgi?id=1704546). This view should be focused on the active tab used when profiling.

Do we plan to go beyond this "active tab" view?

Flags: needinfo?(felash)

Thanks Julian, I was gonna answer this actually.

Indeed we don't plan to do something different for now, we expect that the "active tab" view will work good enough. In the future we'll want a tab switcher in the Profiler UI, I believe that will make it even easier. I also believe we'll want a new sanitization process to remove other tab's information. But nothing that prevents us from releasing !

(In reply to Jan Honza Odvarko [:Honza] (always need-info? me) from comment #5)

Some comments / thoughts:

  • The "Share Performance Profile" popup can show a warning when the profile contains data from Private Browsing Sessions

Doing that is what I outlined in comment 4. This isn't difficult but there's some work.

  • [optional] The DevTools Performance panel could show the same (visually similar) warning informing the user that there are Private Browsing sessions running in the backround that will be included in profiling.

This is a lot easier, so I believe we should do this.

  • Should the default settings in the Performance panel be "Web Developer" as opposed to "Firefox Platform"?

The default is "Firefox Platform" only in nightly or local builds, otherwise it's "Web Developer".
see https://searchfox.org/mozilla-central/rev/9dceacf3d761eb91237108ec438d64099a56f442/modules/libpref/init/all.js#850-857
Is that acceptable?

Also, the "Web Developer" settings isn't equal to "single-tab recording", correct? Do we have a bug for "single-tab recording"?
It feels like regular DevTools users are mostly interested in debugging the current tab, which automatically excludes any other running browser sessions/tabs.

(see above)

Flags: needinfo?(felash)

The default is "Firefox Platform" only in nightly or local builds, otherwise it's "Web Developer".

Makes sense to me, I think it's fine.
Actually yesterday I tested in DevEdition, where I probably had Web Developer by default. So I was a bit surprised when reading the question :)

(In reply to Julien Wajsberg [:julienw] from comment #8)

The default is "Firefox Platform" only in nightly or local builds, otherwise it's "Web Developer".
see https://searchfox.org/mozilla-central/rev/9dceacf3d761eb91237108ec438d64099a56f442/modules/libpref/init/all.js#850-857
Is that acceptable?

I agree, this makes sense, yes.
Thank you, Julien

ni? myself to make this move forward

Flags: needinfo?(jdescottes)
Assignee: nobody → felash

I'm working on this now :-)

Flags: needinfo?(jdescottes)
Attachment #9247586 - Attachment description: WIP: Bug 1639716 - Add a property to the root actor's traits and pass all traits to the gInit function → WIP: Bug 1639716 - [devtools performance] Add a property to the root actor's traits and pass all traits to the gInit function
Attachment #9247587 - Attachment description: WIP: Bug 1639716 - Use the traits to control the call to the removed functionality → WIP: Bug 1639716 - [devtools performance] Use the traits to control the call to the removed functionality
Attachment #9247588 - Attachment description: WIP: Bug 1639716 - Remove all actor code related to the profiler locking mechanism by private browsing → WIP: Bug 1639716 - [devtools performance] Remove all actor code related to the profiler locking mechanism by private browsing
Attachment #9247589 - Attachment description: WIP: Bug 1639716 - Cleanup: pass the openAboutProfiling function from panel.js for more simplicity → WIP: Bug 1639716 - [devtools performance] Cleanup: pass the openAboutProfiling function from panel.js for more simplicity
Attachment #9247584 - Attachment description: WIP: Bug 1639716 - [profiler] Add the private browsing information about registered pages → Bug 1639716 - [profiler] Record the private browsing information in registered pages r=gerald
Attachment #9247585 - Attachment description: WIP: Bug 1639716 - [profiler] Remove the profiler disabling by private browsing → Bug 1639716 - [profiler] Remove the profiler disabling by private browsing r=jdescottes!,gerald!
Attachment #9247586 - Attachment description: WIP: Bug 1639716 - [devtools performance] Add a property to the root actor's traits and pass all traits to the gInit function → Bug 1639716 - [devtools performance] Add a property to the root actor's traits and pass all traits to the gInit function r=jdescottes!
Attachment #9247587 - Attachment description: WIP: Bug 1639716 - [devtools performance] Use the traits to control the call to the removed functionality → Bug 1639716 - [devtools performance] Use the traits to control the call to the removed functionality r=jdescottes!
Attachment #9247588 - Attachment description: WIP: Bug 1639716 - [devtools performance] Remove all actor code related to the profiler locking mechanism by private browsing → Bug 1639716 - [devtools performance] Remove all actor code related to the profiler locking mechanism by private browsing r=jdescottes!
Attachment #9247589 - Attachment description: WIP: Bug 1639716 - [devtools performance] Cleanup: pass the openAboutProfiling function from panel.js for more simplicity → Bug 1639716 - [devtools performance] Cleanup: pass the openAboutProfiling function from panel.js for more simplicity r=jdescottes!
Attachment #9247775 - Attachment description: WIP: Bug 1639716 - [devtools performance] Capture profiles only in non-private windows → Bug 1639716 - [devtools performance] Capture profiles only in non-private windows r=jdescottes!
Attachment #9248248 - Attachment description: WIP: Bug 1639716 - [profiler] Extract origin attributes out of the eTLD+1 and output them as thread properties → Bug 1639716 - [profiler] Extract origin attributes out of the eTLD+1 and output them as thread properties r=gerald!
Attachment #9248249 - Attachment description: WIP: Bug 1639716 - [profiler, network markers] Add information about private browsing in network markers → Bug 1639716 - [profiler, network markers] Add information about private browsing in network markers r=valentin!,gerald!
Depends on: 1745208
Attachment #9247584 - Attachment description: Bug 1639716 - [profiler] Record the private browsing information in registered pages r=gerald → WIP: Bug 1639716 - [profiler] Record the private browsing information in registered pages r=gerald
Attachment #9247585 - Attachment description: Bug 1639716 - [profiler] Remove the profiler disabling by private browsing r=jdescottes!,gerald! → WIP: Bug 1639716 - [profiler] Remove the profiler disabling by private browsing r=jdescottes!,gerald!
Attachment #9247586 - Attachment description: Bug 1639716 - [devtools performance] Add a property to the root actor's traits and pass all traits to the gInit function r=jdescottes! → WIP: Bug 1639716 - [devtools performance] Add a property to the root actor's traits and pass all traits to the gInit function r=jdescottes!
Attachment #9247587 - Attachment description: Bug 1639716 - [devtools performance] Use the traits to control the call to the removed functionality r=jdescottes! → WIP: Bug 1639716 - [devtools performance] Use the traits to control the call to the removed functionality r=jdescottes!
Attachment #9247588 - Attachment description: Bug 1639716 - [devtools performance] Remove all actor code related to the profiler locking mechanism by private browsing r=jdescottes! → WIP: Bug 1639716 - [devtools performance] Remove all actor code related to the profiler locking mechanism by private browsing r=jdescottes!
Attachment #9247589 - Attachment description: Bug 1639716 - [devtools performance] Cleanup: pass the openAboutProfiling function from panel.js for more simplicity r=jdescottes! → WIP: Bug 1639716 - [devtools performance] Cleanup: pass the openAboutProfiling function from panel.js for more simplicity r=jdescottes!
Attachment #9247775 - Attachment description: Bug 1639716 - [devtools performance] Capture profiles only in non-private windows r=jdescottes! → WIP: Bug 1639716 - [devtools performance] Capture profiles only in non-private windows r=jdescottes!
Attachment #9248248 - Attachment description: Bug 1639716 - [profiler] Extract origin attributes out of the eTLD+1 and output them as thread properties r=gerald! → WIP: Bug 1639716 - [profiler] Extract origin attributes out of the eTLD+1 and output them as thread properties r=gerald!
Attachment #9248249 - Attachment description: Bug 1639716 - [profiler, network markers] Add information about private browsing in network markers r=valentin!,gerald! → WIP: Bug 1639716 - [profiler, network markers] Add information about private browsing in network markers r=valentin!,gerald!
Attachment #9247584 - Attachment description: WIP: Bug 1639716 - [profiler] Record the private browsing information in registered pages r=gerald → Bug 1639716 - [profiler] Record the private browsing information in registered pages r=gerald
Attachment #9247585 - Attachment description: WIP: Bug 1639716 - [profiler] Remove the profiler disabling by private browsing r=jdescottes!,gerald! → Bug 1639716 - [profiler] Remove the profiler disabling by private browsing r=jdescottes!,gerald!
Attachment #9247586 - Attachment description: WIP: Bug 1639716 - [devtools performance] Add a property to the root actor's traits and pass all traits to the gInit function r=jdescottes! → Bug 1639716 - [devtools performance] Add a property to the root actor's traits and pass all traits to the gInit function r=jdescottes!
Attachment #9247587 - Attachment description: WIP: Bug 1639716 - [devtools performance] Use the traits to control the call to the removed functionality r=jdescottes! → Bug 1639716 - [devtools performance] Use the traits to control the call to the removed functionality r=jdescottes!
Attachment #9247588 - Attachment description: WIP: Bug 1639716 - [devtools performance] Remove all actor code related to the profiler locking mechanism by private browsing r=jdescottes! → Bug 1639716 - [devtools performance] Remove all actor code related to the profiler locking mechanism by private browsing r=jdescottes!
Attachment #9247589 - Attachment description: WIP: Bug 1639716 - [devtools performance] Cleanup: pass the openAboutProfiling function from panel.js for more simplicity r=jdescottes! → Bug 1639716 - [devtools performance] Cleanup: pass the openAboutProfiling function from panel.js for more simplicity r=jdescottes!
Attachment #9254566 - Attachment description: WIP: Bug 1639716 - [utilityOverlay] Provide a callback in openLinkIn to report when a content browser is created r=gijs! → Bug 1639716 - [utilityOverlay] Provide a callback in openLinkIn to report when a content browser is created r=gijs!
Attachment #9256254 - Attachment description: WIP: Bug 1639716 - [devtools performance] Change a few test helpers so that the window can be specified r=jdescottes! → Bug 1639716 - [devtools performance] Change a few test helpers so that the window can be specified r=jdescottes!
Attachment #9247775 - Attachment description: WIP: Bug 1639716 - [devtools performance] Capture profiles only in non-private windows r=jdescottes! → Bug 1639716 - [devtools performance] Capture profiles only in non-private windows r=jdescottes!
Attachment #9248248 - Attachment description: WIP: Bug 1639716 - [profiler] Extract origin attributes out of the eTLD+1 and output them as thread properties r=gerald! → Bug 1639716 - [profiler] Extract origin attributes out of the eTLD+1 and output them as thread properties r=gerald!
Attachment #9248249 - Attachment description: WIP: Bug 1639716 - [profiler, network markers] Add information about private browsing in network markers r=valentin!,gerald! → Bug 1639716 - [profiler, network markers] Add information about private browsing in network markers r=valentin!,gerald!
Pushed by jwajsberg@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d7b679fcef1f [profiler] Record the private browsing information in registered pages r=gerald https://hg.mozilla.org/integration/autoland/rev/b6301f4ca68c [profiler] Remove the profiler disabling by private browsing r=jdescottes,gerald,devtools-backward-compat-reviewers https://hg.mozilla.org/integration/autoland/rev/53b4be41c530 [devtools performance] Add a property to the root actor's traits and pass all traits to the gInit function r=jdescottes https://hg.mozilla.org/integration/autoland/rev/9aa662b8da5e [devtools performance] Use the traits to control the call to the removed functionality r=jdescottes https://hg.mozilla.org/integration/autoland/rev/001820edfacc [devtools performance] Remove all actor code related to the profiler locking mechanism by private browsing r=jdescottes,devtools-backward-compat-reviewers https://hg.mozilla.org/integration/autoland/rev/b32fc155af27 [devtools performance] Cleanup: pass the openAboutProfiling function from panel.js for more simplicity r=jdescottes https://hg.mozilla.org/integration/autoland/rev/0585facaeb83 [utilityOverlay] Provide a callback in openLinkIn to report when a content browser is created r=Gijs https://hg.mozilla.org/integration/autoland/rev/0747f5dd266b [devtools performance] Change a few test helpers so that the window can be specified r=jdescottes https://hg.mozilla.org/integration/autoland/rev/3ea70d53ef4e [devtools performance] Capture profiles only in non-private windows r=jdescottes https://hg.mozilla.org/integration/autoland/rev/a2e43e51b6ca [profiler] Extract origin attributes out of the eTLD+1 and output them as thread properties r=gerald https://hg.mozilla.org/integration/autoland/rev/de1c260f94f5 [profiler, network markers] Add information about private browsing in network markers r=valentin,gerald,necko-reviewers https://hg.mozilla.org/integration/autoland/rev/a615447107f1 [profiler] Bump the format version to ensure our users get the latest version of the frontend when capturing private browsing data r=gerald

dev-doc-needed for developer-oriented documentation

Keywords: dev-doc-needed
Blocks: 1625541
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: