Closed Bug 1750991 Opened 2 years ago Closed 2 years ago

Add code for creating a Taskbar pin for Private Browsing mode

Categories

(Firefox :: Shell Integration, enhancement, P1)

Desktop
Windows
enhancement

Tracking

()

RESOLVED FIXED
100 Branch
Tracking Status
firefox100 --- fixed

People

(Reporter: bhearsum, Assigned: bhearsum)

References

(Blocks 1 open bug)

Details

(Whiteboard: [fidedi-pbm])

Attachments

(7 files)

This will depend on the new AUMID we'll be adding in https://bugzilla.mozilla.org/show_bug.cgi?id=1750987.

We'll need to create a new Shortcut in $SMPROGRAMS for this, and then pin it to the Taskbar. Our current Taskbar pinning code is https://searchfox.org/mozilla-central/rev/dfc0dea63a16b73078a46b6ae49b2a626b8c11b5/browser/components/shell/nsWindowsShellService.cpp#884-901, but it will likely need a refactor now that we'll have multiple shortcuts for the same application, and it won't be able to accurately find the right one.

This new shortcut should be written out to the same shortcuts log we'll write the Desktop one to in https://bugzilla.mozilla.org/show_bug.cgi?id=1750988.

This code is intended to be called during onboarding, if and when the user has opted in to Privacy Mode.

Hardware: All → Desktop

Probably a dumb question, but how would you localize this shortcut (and other UI elements), if they're added by the installer? How would they interact with language packs?

(In reply to Francesco Lodolo [:flod] from comment #1)

Probably a dumb question, but how would you localize this shortcut (and other UI elements), if they're added by the installer? How would they interact with language packs?

The Taskbar pin (and the Desktop shortcut for that matter) will be added by Firefox itself, not the installer, so I certainly don't think this will be an issue for repacks - the strings we need should be in the right place. For langpacks I'm less certain -- but assuming they set all the strings used by the application correctly, I think it will work.

(https://docs.google.com/document/d/1BPIeMkggeEuc45EWoATqtk_UO1BVSI5Q6KxI50YzpR0/edit# has some background and discussion on this if you're curious, but the tl;dr is that we can't do it in the installer because it depends on the user opting in during onboarding after install or upgrade).

No longer blocks: 1750987
Depends on: 1750987
Blocks: di-pbm

Acceptance criteria:

  • When Firefox Private Browsing is requested to be pinned to the taskbar, a new, distinct icon shows up on the Taskbar
  • The text that appears on hover is "Firefox Private Browsing" (the exact string may change, and will be localized)
  • Clicking on the icon launches a new Firefox Private Browsing window (see caveat below)
  • When Firefox is uninstalled, the Taskbar pin is removed, and the shortcut is deleted

Caveats:

Needs some cleanup but seems to work fine.

Depends on D138194

Needs significant cleanup, but it works

Depends on D138195

Needs significant cleanup and a few improvements, including:

  • Using a unique icon for Private Browsing
  • The WriteShortcutToLog call should be happening in CreateShortcut, not PinAppToTaskbarImpl
  • Handle localized shortcuts

Depends on D138196

Blocks: 1754314

This is now for enough along that some more robust testing would be beneficial. The steps to do so are:

  1. Install my try build with these patches applied
  2. Launch Firefox
  3. Set devtools.chrome.enabled to true
  4. Open up the Browser Console and run the following code:
shellService.pinToTaskbar(true);

Expected results:

  • A new pinned item appears in the Taskbar on Windows 10 & 11 (Windows 7 & 8 support will be coming soon).
  • The string on hover should be "Firefox Private Browsing"
  • The icon is currently undefined - so whatever it shows is fine for now
  • Clicking on the taskbar icon opens a new Private Browsing window in the existing instance of Firefox
Assignee: nobody → bhearsum
Attached image error.png

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

This is now for enough along that some more robust testing would be beneficial. The steps to do so are:

  1. Install my try build with these patches applied
  2. Launch Firefox
  3. Set devtools.chrome.enabled to true
  4. Open up the Browser Console and run the following code:
shellService.pinToTaskbar(true);

We followed above steps but shortcut is not created(see screenshot attached with error), also none of the below results happen.

Expected results:

  • A new pinned item appears in the Taskbar on Windows 10 & 11 (Windows 7 & 8 support will be coming soon).
  • The string on hover should be "Firefox Private Browsing"
  • The icon is currently undefined - so whatever it shows is fine for now
  • Clicking on the taskbar icon opens a new Private Browsing window in the existing instance of Firefox

(In reply to Monica Chiorean from comment #9)

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

This is now for enough along that some more robust testing would be beneficial. The steps to do so are:

  1. Install my try build with these patches applied
  2. Launch Firefox
  3. Set devtools.chrome.enabled to true
  4. Open up the Browser Console and run the following code:
shellService.pinToTaskbar(true);

We followed above steps but shortcut is not created(see screenshot attached with error), also none of the below results happen.

Shoot - sorry. That was supposed to be ShellService.pinToTaskbar(true);

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

(In reply to Monica Chiorean from comment #9)

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

This is now for enough along that some more robust testing would be beneficial. The steps to do so are:

  1. Install my try build with these patches applied
  2. Launch Firefox
  3. Set devtools.chrome.enabled to true
  4. Open up the Browser Console and run the following code:
shellService.pinToTaskbar(true);

We followed above steps but shortcut is not created(see screenshot attached with error), also none of the below results happen.

Shoot - sorry. That was supposed to be ShellService.pinToTaskbar(true);

We tried the new build and command and it works (we managed to install and have the shortcut, also all Acceptance criteria passed), but we have found some new issue that we need to clarify:

  • On Win10 jumplist of Tasks is not always showing after reinstall (need to investigate more).
  • On Win10 jumplist has a scroll bar that is not necessary (will attach a screenshot).
  • On Win11 there is an error displayed when trying to access a normal page from Private window (will attach a screenshot).
Attached image error2.png
Attached image scroll_bar.png

Sorry for the delayed response here.

(In reply to Monica Chiorean from comment #11)

  • On Win10 jumplist of Tasks is not always showing after reinstall (need to investigate more).

This might just be a matter of waiting a bit longer. The jump lists are built on delay, so will not show immediately.

  • On Win10 jumplist has a scroll bar that is not necessary (will attach a screenshot).

This is...very strange. I haven't seen it myself, although I have seen some references to it happening when screen scaling is used (eg: https://answers.microsoft.com/en-us/insider/forum/all/scroll-bars-in-jump-lists-at-125-scaling-in/f7e2b93e-3089-4e86-9da3-267615b90a82).

  • On Win11 there is an error displayed when trying to access a normal page from Private window (will attach a screenshot).

This seems to indicate that one version of Firefox is trying to launch another version. If it's not too late, it would be useful to know which versions of Firefox were installed on the system, and their installations directories.

Attachment #9262918 - Attachment description: WIP: Bug 1750991: Add helper for writing to a new shortcuts log in ProgramData → Bug 1750991: Add helper for writing to a new shortcuts log in ProgramData. r?mhowell!
Attachment #9262919 - Attachment description: WIP: Bug 1750991: Make it possible to pin private browsing shortcut to taskbar → Bug 1750991: Add support for pinning a a Private Browsing mode shortcut to the Taskbar. r?mhowell!
Attachment #9262920 - Attachment description: WIP: Bug 1750991: Automatically create shortcut if it's not already present when pinning to the Windows Taskbar → Bug 1750991: Automatically create shortcut if it's not already present when pinning to the Windows Taskbar. r?mhowell!
Attachment #9264653 - Attachment description: WIP: Bug 1750991: Add support for pinning to taskbar in Windows 7 & 8 through WindowsShellService → Bug 1750991: Add support for pinning to taskbar in Windows 7 & 8 through WindowsShellService. r?mhowell!
Component: Installer → Shell Integration

Today we decided that we're explicitly not going to support pinning to taskbar for older versions of Windows 10 (pre-1809) - at least for now. The relative usage of it is low enough that it's not worth the effort. We do have some code for doing so in the installer that we could port to Firefox itself - but we'll punt on it for now.

Pushed by bhearsum@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/18f705f09d22
Add helper for writing to a new shortcuts log in ProgramData. r=mhowell
https://hg.mozilla.org/integration/autoland/rev/4a8fa80f53f3
Add support for pinning a a Private Browsing mode shortcut to the Taskbar. r=mhowell
https://hg.mozilla.org/integration/autoland/rev/04847d9f5497
Automatically create shortcut if it's not already present when pinning to the Windows Taskbar. r=mhowell
https://hg.mozilla.org/integration/autoland/rev/a2be740a9dbd
Add support for pinning to taskbar in Windows 7 & 8 through WindowsShellService. r=mhowell
Blocks: 1750987
No longer depends on: 1750987
See Also: → 1854516
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: