Closed Bug 1750988 Opened 2 years ago Closed 2 years ago

Add code for creating a desktop shortcut for Private Browsing mode

Categories

(Firefox :: Shell Integration, enhancement, P1)

Desktop
Windows
enhancement

Tracking

()

RESOLVED WONTFIX

People

(Reporter: bhearsum, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [fidedi-pbm])

Attachments

(1 obsolete file)

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

Some older, since backed out work, on Site Specific Browsers is likely going to be helpful here. https://hg.mozilla.org/mozilla-central/rev/f0955f658b1e is a patch that allows for the creating a shortcut with a custom AUMID.

In order to make sure that we can update the icons on these shortcuts, remove them on uninstall, etc. - we will write out a new shortcuts log to ProgramData\Mozilla. It should be exactly the same as the shortcuts log created by the installer, and post-update, the uninstaller, and anything else that uses the existing shortcuts log will need to be updated to look for this one as well.

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

OS: Unspecified → Windows
Hardware: Unspecified → Desktop
No longer blocks: 1750987
Depends on: 1750987
Blocks: di-pbm

I did a bit of poking on how to do this for MSIX today. It turns out we can add a second <Application> entry to the manifest (below) that can have its own icon, parameters, etc. like so:

+    <Application Id="Private" Executable="VFS\ProgramFiles\@APPX_INSTDIR@\@MOZ_APP_NAME@.exe" EntryPoint="Windows.FullTrustApplication" uap10:Parameters="-private-window">
+      <uap:VisualElements BackgroundColor="#20123A" DisplayName="@MOZ_APP_DISPLAYNAME@ private" Square150x150Logo="Assets\Square150x150Logo.png" Square44x44Logo="Assets\Document44x44.png" Description="@MOZ_APP_DISPLAYNAME@ private">
+        <uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png" Square310x310Logo="Assets\LargeTile.png" Square71x71Logo="Assets\SmallTile.png" />
+      </uap:VisualElements>
+      <Extensions>
+        <uap3:Extension Category="windows.protocol">
+          <uap3:Protocol Name="http" Parameters="-osint -private-window &quot;%1&quot;">
+            <uap:DisplayName>http</uap:DisplayName>
+            <uap:Logo>Assets\Document44x44.png</uap:Logo>
+          </uap3:Protocol>
+        </uap3:Extension>
+        <uap3:Extension Category="windows.protocol">
+          <uap3:Protocol Name="https" Parameters="-osint -private-window &quot;%1&quot;">
+            <uap:DisplayName>https</uap:DisplayName>
+            <uap:Logo>Assets\Document44x44.png</uap:Logo>
+          </uap3:Protocol>
+        </uap3:Extension>
+        <uap3:Extension Category="windows.protocol">
+          <uap3:Protocol Name="mailto" Parameters="-osint -private-window &quot;%1&quot;">
+            <uap:DisplayName>mailto</uap:DisplayName>
+            <uap:Logo>Assets\Document44x44.png</uap:Logo>
+          </uap3:Protocol>
+        </uap3:Extension>
+      </Extensions>
+    </Application>

With that in place, we can create shortcuts to things such as "shell:appsFolder\Mozilla.MozillaNightly_abcdefghijkl!Private" that will correctly open a new window in Private Browsing mode. This also automatically adds a Private Browsing shortcut to the Start Menu (I don't think we can prevent that).

Notably, the second entry does not contain file extension handlers -- the manifets gets rejected if both <Application> entries include them.

This has been descoped for the current project.

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → WONTFIX
Attachment #9262888 - Attachment is obsolete: true
Component: Installer → Shell Integration
Blocks: 1750987
No longer depends on: 1750987
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: