Closed Bug 1762994 Opened 2 years ago Closed 2 years ago

pinning Private Browsing window to Taskbar with windows context menu item pins regular Firefox

Categories

(Firefox :: Installer, defect, P2)

All
Windows
defect

Tracking

()

VERIFIED FIXED
103 Branch
Tracking Status
firefox103 --- verified

People

(Reporter: bhearsum, Assigned: bhearsum)

References

(Blocks 1 open bug)

Details

(Whiteboard: [fidedi-pbm])

Attachments

(3 files)

STR:

  1. Set browser.privacySegmentation.enabled to true
  2. Open a new Private Browsing window -- it should show up with the purple mask icon in the Taskbar
  3. Right click on it and "Pin To Taskbar"

Expected Result: Mask icon should be permanently pinned to taskbar, and when Firefox is launched with it, it should open a Private Browsing window

Actual Result: Icon changes to the regular Firefox icon, and launches regular Firefox

I haven't verified this, but I expect that under the hood Windows is creating a shortcut with the wrong args, icon, and AUMID set.

Assignee: nobody → bhearsum
Severity: S2 → S3

(In reply to bhearsum@mozilla.com (:bhearsum) from comment #0)

I haven't verified this, but I expect that under the hood Windows is creating a shortcut with the wrong args, icon, and AUMID set.

I dug some more today and this appears to be the case. When I use the "Pin to Taskbar" context menu item there's a new shortcut that shows up in %appdata%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar that is just a plain Firefox one.

I managed to get it to pin correctly if I first created a shortcut myself. For example, if I first run:

let b = new nsIFile("c:\\Program Files\\Mozilla Firefox\\firefox.exe")
shellservice.createShortcut(b, ["-private-window"], "bhearsum test", b, 4, "308046B0AF4A39CB;PrivateBrowsingAUMID", "StartMenu", "Firefox Private.lnk")

...and then pin to Taskbar through the context menu it still creates a new shortcut in the directory above, but it appears to copy the one I created rather than create its own.

This says to me that we should probably create this Private Browsing mode shortcut early -- probably in the installer, and then possibly check for it again at runtime (to handle zip builds or any other case where the shortcut doesn't already exist).

Romain, how do you feel about creating a Private Browsing shortcut at install time? Ensuring a shortcut exists before the user has the opportunity to Pin to Taskbar with Windows UI is the only known way of fixing this at the moment.

Flags: needinfo?(rtestard)

Not sure I understand, are you suggesting we place the shortcut on the taskbar as part of the installation? This would imply no need to get users to pin to taskbar although doing this on behalf of the user feels like potential annoyance IIUIC

Flags: needinfo?(rtestard)

(In reply to Romain Testard [:RT] from comment #3)

Not sure I understand, are you suggesting we place the shortcut on the taskbar as part of the installation? This would imply no need to get users to pin to taskbar although doing this on behalf of the user feels like potential annoyance IIUIC

Sorry, let me clarify: the fix I'm proposing for this bug is to create the Shortcut for Private Browsing mode in the installer -- which means it would show up in the Start Menu at install time. It would not pin to the taskbar automatically. (Incidentally, this is the same thing we do for the non-private shortcut.)

Flags: needinfo?(rtestard)

Thanks for clarifying, I never realized that pinning to 'start' was a thing.
I see the list is fairly long - I agree we should do that since it aligns well with our goal to make Firefox private feel like a separate application.

Flags: needinfo?(rtestard)

The shortcut creation code was mapping the "StartMenu" known folder to what is actually a "Programs" folder. This patch fixes that, and updates some related code to match. Notably, no behaviour has changed (ie: we still create shortcuts in the same place) -- this just makes it more obvious what's happening.

This fixes a bug where pinning a Private Browsing window to Taskbar with the windows context menu item pins regular Firefox instead. This happens because Windows cannot find an appropriate shortcut (presumably by looking for one with the right AUMID), and ends up creating its own instead -- with almost entirely incorrect metadata.

With this, we'll be creating one at a few points (if it doesn't already exist):

  • Installer - for new installs
  • Post-Update - to make sure we get one when people update to the first version where we pref this on
  • Startup idle - for zip installs, and to handle any other possible case where the shortcut doesn't exist

This patch should not be landed until a couple of things happen:

  • We finalize the en-US strings
  • We stop gating the Private Window taskbar separation on a pref (otherwise we'll have shortcuts created that launch with the Private icon into a regular Firefox taskbar icon)

Depends on D147701

QA, when this lands it will be pref'ed off. You will need to do a couple of things to pref it on:

  • Set a registry key to enable shortcut creation in the installer. The exact key depends on the install path. Here are the keys to use for Nightly & Beta:
    ** Nightly: HKEY_CURRENT_USER\SOFTWARE\Mozilla\Firefox\Installer\6F193CCC56814779\CreatePrivateBrowsingShortcut -- this should be a DWORD set to 1.
    ** Beta: HKEY_CURRENT_USER\SOFTWARE\Mozilla\Firefox\Installer\308046B0AF4A39CB\CreatePrivateBrowsingShortcut -- this should be a DWORD set to 1
  • Set browser.privacySegmentation.enabled to true

The testing that I did myself is described in https://phabricator.services.mozilla.com/D147702 -- the main thing I think needs to be checked is that shortcuts are created in the following scenarios, and pin to the taskbar with the correct icon and tooltip text:

  • Shortcut created through the installer
  • Installer shortcut has been deleted, and is recreated after relaunching Firefox

And also that if the second shortcut is deleted, it is not recreated again.

If you need any other details or instructions to help verify this please let me know.

Pushed by bhearsum@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1c09ae99c970
fix inconsistency in nsWindowsShellService folder ID handling r=mhowell
https://hg.mozilla.org/integration/autoland/rev/3607881d22b3
ensure a Private Browsing shortcut exists as early as possible r=mhowell,fluent-reviewers
Flags: qe-verify?
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 103 Branch

(In reply to bhearsum@mozilla.com (:bhearsum) from comment #8)

QA, when this lands it will be pref'ed off. You will need to do a couple of things to pref it on:

  • Set a registry key to enable shortcut creation in the installer. The exact key depends on the install path. Here are the keys to use for Nightly & Beta:
    ** Nightly: HKEY_CURRENT_USER\SOFTWARE\Mozilla\Firefox\Installer\6F193CCC56814779\CreatePrivateBrowsingShortcut -- this should be a DWORD set to 1.
    ** Beta: HKEY_CURRENT_USER\SOFTWARE\Mozilla\Firefox\Installer\308046B0AF4A39CB\CreatePrivateBrowsingShortcut -- this should be a DWORD set to 1
  • Set browser.privacySegmentation.enabled to true

The testing that I did myself is described in https://phabricator.services.mozilla.com/D147702 -- the main thing I think needs to be checked is that shortcuts are created in the following scenarios, and pin to the taskbar with the correct icon and tooltip text:

  • Shortcut created through the installer
  • Installer shortcut has been deleted, and is recreated after relaunching Firefox

And also that if the second shortcut is deleted, it is not recreated again.

If you need any other details or instructions to help verify this please let me know.

I was able to set the registry key and set the pref' on and the shortcut was created and uninstalled without any issues on Nightly build.
But after a clean install (uninstall the app and removing everything from App data folder) and a pref'on I was able to see the shortcut created on Start menu without setting the registry key - Is this expected ?

(In reply to Monica Chiorean from comment #11)

(In reply to bhearsum@mozilla.com (:bhearsum) from comment #8)

QA, when this lands it will be pref'ed off. You will need to do a couple of things to pref it on:

  • Set a registry key to enable shortcut creation in the installer. The exact key depends on the install path. Here are the keys to use for Nightly & Beta:
    ** Nightly: HKEY_CURRENT_USER\SOFTWARE\Mozilla\Firefox\Installer\6F193CCC56814779\CreatePrivateBrowsingShortcut -- this should be a DWORD set to 1.
    ** Beta: HKEY_CURRENT_USER\SOFTWARE\Mozilla\Firefox\Installer\308046B0AF4A39CB\CreatePrivateBrowsingShortcut -- this should be a DWORD set to 1
  • Set browser.privacySegmentation.enabled to true

The testing that I did myself is described in https://phabricator.services.mozilla.com/D147702 -- the main thing I think needs to be checked is that shortcuts are created in the following scenarios, and pin to the taskbar with the correct icon and tooltip text:

  • Shortcut created through the installer
  • Installer shortcut has been deleted, and is recreated after relaunching Firefox

And also that if the second shortcut is deleted, it is not recreated again.

If you need any other details or instructions to help verify this please let me know.

I was able to set the registry key and set the pref' on and the shortcut was created and uninstalled without any issues on Nightly build.
But after a clean install (uninstall the app and removing everything from App data folder) and a pref'on I was able to see the shortcut created on Start menu without setting the registry key - Is this expected ?

Was the registry key still set when you did the install? (The uninstaller may not remove it.)

Flags: needinfo?(monica.chiorean)
Attached image Registry.jpg

It removed the key that I added 'CreatePrivateBrowsingShortcut' as it does not appear under Installer folder.

Flags: needinfo?(monica.chiorean)

(In reply to Monica Chiorean from comment #11)

(In reply to bhearsum@mozilla.com (:bhearsum) from comment #8)

QA, when this lands it will be pref'ed off. You will need to do a couple of things to pref it on:

  • Set a registry key to enable shortcut creation in the installer. The exact key depends on the install path. Here are the keys to use for Nightly & Beta:
    ** Nightly: HKEY_CURRENT_USER\SOFTWARE\Mozilla\Firefox\Installer\6F193CCC56814779\CreatePrivateBrowsingShortcut -- this should be a DWORD set to 1.
    ** Beta: HKEY_CURRENT_USER\SOFTWARE\Mozilla\Firefox\Installer\308046B0AF4A39CB\CreatePrivateBrowsingShortcut -- this should be a DWORD set to 1
  • Set browser.privacySegmentation.enabled to true

The testing that I did myself is described in https://phabricator.services.mozilla.com/D147702 -- the main thing I think needs to be checked is that shortcuts are created in the following scenarios, and pin to the taskbar with the correct icon and tooltip text:

  • Shortcut created through the installer
  • Installer shortcut has been deleted, and is recreated after relaunching Firefox

And also that if the second shortcut is deleted, it is not recreated again.

If you need any other details or instructions to help verify this please let me know.

I was able to set the registry key and set the pref' on and the shortcut was created and uninstalled without any issues on Nightly build.
But after a clean install (uninstall the app and removing everything from App data folder) and a pref'on I was able to see the shortcut created on Start menu without setting the registry key - Is this expected ?

Oh - I see what's happening. Because you've pref'ed through browser.privacySegmentation.enabled on you're hitting the case where we create the shortcut at first run (once). You can verify that by repeating the test, but removing the Firefox profile before you install the second time.

Flags: needinfo?(monica.chiorean)

I installed on a clean Win10 environment Nightly and Beta builds and I was able to create the shortcut only by setting pref to True. Is this correct?
On Win7 with new install and new profile the shortcut is created only be modifying pref.

Flags: needinfo?(monica.chiorean)

There are two scenarios in which the shortcut will be created:

  1. If you set the registry key before running the installer
  2. If you set the pref, Firefox will create the shortcut the next time you start it

(In reply to Monica Chiorean from comment #15)

I installed on a clean Win10 environment Nightly and Beta builds and I was able to create the shortcut only by setting pref to True. Is this correct?
On Win7 with new install and new profile the shortcut is created only be modifying pref.

Can you provide a more precise STR? The above sounds like you've done the same thing on Windows 7 & Windows 10.

Flags: needinfo?(monica.chiorean)

Provided steps on slack.

Flags: needinfo?(monica.chiorean)

(In reply to Monica Chiorean from comment #17)

Provided steps on slack.

And to close the loop, we concluded on Slack that it was expected behaviour.

Depends on: 1778463

We've completed the regression testing for this bug in order to verify that no regressions have been introduced, and the feature still works as expected. Also, we've added a couple of new tests to cover the scenarios mentioned in comment 8.

We can confirm that the changes are working as expected on Beta 103.0b, since QA did not uncover any new issues. This was tested with Win 10 x64, Win 11 x64 and Win 7 x64.

The test report can be found here.

Closing this bug verified as fixed per above.

Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: