Closed Bug 1686343 Opened 5 months ago Closed 3 months ago

Ask user to pin Firefox during windows about:welcome onboarding

Categories

(Firefox :: Messaging System, enhancement, P1)

enhancement

Tracking

()

VERIFIED FIXED
87 Branch
Iteration:
87.2 - Feb 8 - Feb 21
Tracking Status
firefox87 - verified

People

(Reporter: Mardak, Assigned: Mardak)

References

(Blocks 2 open bugs)

Details

Attachments

(8 files)

Ideally somehow we do this requiring only 1 click from the user, and to start we can focus on windows 10. As from bug 1558206, automatic pinning stopped working from Windows 10 1903, so we might want to show this messaging for newer versions of Windows?

See Also: → 1558206

While I'm not a developer and I don't have a full grasp on what has broken in the past, there does still seem to be an API for this.
https://docs.microsoft.com/en-us/windows/uwp/design/shell/pin-to-taskbar

The key thing is that it "must be called from a foreground UI thread, otherwise an exception will be thrown."

(In reply to Alex Davis [:adavis] from comment #1)

https://docs.microsoft.com/en-us/windows/uwp/design/shell/pin-to-taskbar
The key thing is that it "must be called from a foreground UI thread, otherwise an exception will be thrown."

I'm definitely not familiar with windows firefox development, but looks like we do have various uses of the windows runtime api adjacent to Windows.UI.Shell:
https://searchfox.org/mozilla-central/search?q=%3Cwindows.ui

The specific TaskbarManager.RequestPinCurrentApp API was added for version 1709 / build 16299, and it's still available in version 1903+ that we're particularly interested in:
https://docs.microsoft.com/en-us/uwp/api/windows.ui.shell.taskbarmanager.requestpincurrentappasync

Previous pinning behavior seems to have been done during installation via https://searchfox.org/mozilla-central/source/browser/installer/windows/nsis/shared.nsh

mhowell, is using this api a reasonable approach, and if so I can try setting up a windows development environment? Or if there's a simpler way for me to prototype using the windows runtime APIs from a windows build?

Flags: needinfo?(mhowell)

I don't think the TaskbarManager interface is available to Win32 apps; just trying to instantiate it out of either the (deprecated) WRL mechanism that we use elsewhere or the more current cppwinrt library results in an ERROR_NOT_FOUND exception. I don't know for sure because I don't see this documented, but I assume that means it can only be called from within a UWP app.

Flags: needinfo?(mhowell)
Attached image onboarding mockup

I just made up some strings assuming Firefox is not pinned. At least for an experiment, we should be able to target something like os.windowsBuildNumber >= 18362 to avoid showing this message to windows users who already have firefox pinned. Alternatively, the message could be more generic and shown to all windows users, e.g., "make sure firefox is pinned to your taskbar for easy access"

Severity: -- → S3
Iteration: --- → 86.3 - Jan 11 - Jan 24
Priority: -- → P1
Depends on: 1687562
Attached image using pin API

Instead of the previous attachment 9197495 [details] which asks the user to do the actions of pinning to taskbar, if there was an API like bug 1687562, ideally we could show something like attached instead. (Again, I'm just making up strings.)

We might want something like bug 1685213 to tell if Firefox is already pinned to avoid showing this screen/message.

See Also: → 1685213
Iteration: 86.3 - Jan 11 - Jan 24 → 87.1 - Jan 25 - Feb 7
Assignee: nobody → edilee

Meant to mark this bug depends instead of bug 1687562 comment 11. With the ability to detect that Firefox is pinned or failed to get pinned with bug 1685213, we could show a followup message after attempting to pin, e.g., "Automatic Firefox pinning was unsuccessful. Please open the menu for the Firefox icon in the taskbar to pin."

Depends on: 1685213
Iteration: 87.1 - Jan 25 - Feb 7 → 87.2 - Feb 8 - Feb 21
No longer depends on: 1685213

Here's a recording of the 64 bit target.zip build from https://treeherder.mozilla.org/jobs?repo=try&revision=4d73080718fe89fdb40a057b5b5d17bf9003d717 extracted to my desktop.

Looks like it can result in a duplicate taskbar item when pinning the executable directly. Although in the recording, I launched it from a desktop shortcut, and it worked this particular time…

const { path } = Services.dirsvc.get("XREExeF", Ci.nsIFile);
pinnedList.contents.vtbl.contents.Modify(
  pinnedList,
  null,
  ILCreateFromPathW(path),
  12345
);

I'll try this suggestion next: "if the taskbar doesn't already know about the app, it may not be able to figure out what AUMID to put in the taskbar shortcut. Giving Modify the path to the Start Menu shortcut (under %PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs for a All Users install) should avoid that."

One of the potential treatment branches could show both pinning and default browser instead of having each on separate onboarding welcome screens. Here's a quick proof of concept reusing the "theme" tile selection. https://hg.mozilla.org/try/rev/dd6b11d89a12fe0f230f4d0982d48df5abae6438

[Tracking Requested - why for this release]: Product team would like to see this feature and experiment in 87

The soft code freeze / feature complete deadline for 87 is in a couple of days, when do we expect this to be ready to land?

Flags: needinfo?(tspurway)

I just used a dummy image for now, but it's supposed to be an animation showing firefox getting selected from a list of defaults like in https://www.figma.com/proto/KqQZwwLhft9cUIcBtMVmbz/Desktop-First-Run?node-id=3698%3A0&scaling=min-zoom

I'm not sure it gets explicit user consent because nothing regarding "pin to taskbar" is shown until the user clicks the button.

Support pin special action and add a new action property to wait for default browser that changes styles and content.

Attached image animation.gif

animated GIF for this screen

(In reply to Masatoshi Kimura [:emk] from comment #13)

I'm not sure it gets explicit user consent because nothing regarding "pin to taskbar" is shown until the user clicks the button.

Ah indeed. The copy was wrong. Looks like the current copy is…

Treatment C:
Title: Start by making Firefox a click away
Initial subtitle: Fast, safe, and private browsing every time you use the web.
Initial button: Pin Firefox and Set to Default
Initial help: Make Firefox your main browser
Updated subtitle: Choose Firefox under Web browser when your settings open
Updated image: <attachment 9204057 [details]>
Updated button/help: <removed>

Treatment D -- mostly like Treatment C except…
Initial button: Make Firefox My Primary Browser
Initial help: Pin Firefox to taskbar and open settings
(see attached)

As these are remote experiment branches, we can adjust the copy, etc. even after the code changes land.

Blocks: 1693736
Pushed by elee@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/af7e4b09a4fb
Ask user to pin Firefox during windows about:welcome onboarding r=pdahiya
Status: NEW → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 87 Branch

This is now in nightly 87, and we should have all the pieces needed for an 87 release experiment for pinning from about:welcome.

QA steps (for new functionality in this bug and dependent windows API bug -- but not for the experiment, which has more branches/targeting):

  1. install firefox on windows via installer, e.g., https://nightly.mozilla.org/ download link
  2. open about:config
  3. set browser.aboutwelcome.overrideContent pref to desired value (examples below)
  4. open about:welcome
  5. ensure firefox is pinned/unpinned from taskbar and/or default/not-default browser
  6. go through about:welcome onboarding

Potential treatment D branch with combined action button that pins firefox to taskbar and opens windows' default settings dialog where about:welcome shows the next screen when Firefox becomes the default browser

{"template":"multistage","screens":[{"id":"AW_PIN_AND_DEFAULT","order":0,"content":{"title":"Start by making Firefox a click away","subtitle":"Fast, safe, and private browsing every time you use the web.","help_text":{"position":"default","text":"Pin Firefox to taskbar and open settings"},"primary_button":{"label":"Make Firefox My Primary Browser","action":{"navigate":true,"type":"PIN_AND_DEFAULT","waitForDefault":true}},"secondary_button":{"label":{"string_id":"onboarding-multistage-set-default-secondary-button-label"},"action":{"navigate":true}},"secondary_button_top":{"text":{"string_id":"onboarding-multistage-welcome-secondary-button-text"},"label":{"string_id":"onboarding-multistage-welcome-secondary-button-label"},"action":{"data":{"entrypoint":"activity-stream-firstrun"},"type":"SHOW_FIREFOX_ACCOUNTS","addFlowParams":true}},"waiting_for_default":{"subtitle":"Choose Firefox under Web browser when your settings open","help_text":null,"primary_button":null,"tiles":{"media_type":"tiles-delayed","type":"image","source":{"default":"chrome://activity-stream/content/data/content/assets/remote/windows-default-browser.gif"}}}}},{"id":"AW_IMPORT_SETTINGS","order":1,"content":{"zap":true,"help_text":{"text":{"string_id":"onboarding-import-sites-disclaimer"}},"title":{"string_id":"onboarding-multistage-import-header"},"subtitle":{"string_id":"onboarding-multistage-import-subtitle"},"tiles":{"type":"topsites","showTitles":true},"primary_button":{"label":{"string_id":"onboarding-multistage-import-primary-button-label"},"action":{"type":"SHOW_MIGRATION_WIZARD","navigate":true}},"secondary_button":{"label":{"string_id":"onboarding-multistage-import-secondary-button-label"},"action":{"navigate":true}}}},{"id":"AW_CHOOSE_THEME","order":2,"content":{"zap":true,"title":{"string_id":"onboarding-multistage-theme-header"},"subtitle":{"string_id":"onboarding-multistage-theme-subtitle"},"tiles":{"type":"theme","action":{"theme":"<event>"},"data":[{"theme":"automatic","label":{"string_id":"onboarding-multistage-theme-label-automatic"},"tooltip":{"string_id":"onboarding-multistage-theme-tooltip-automatic-2"},"description":{"string_id":"onboarding-multistage-theme-description-automatic-2"}},{"theme":"light","label":{"string_id":"onboarding-multistage-theme-label-light"},"tooltip":{"string_id":"onboarding-multistage-theme-tooltip-light-2"},"description":{"string_id":"onboarding-multistage-theme-description-light"}},{"theme":"dark","label":{"string_id":"onboarding-multistage-theme-label-dark"},"tooltip":{"string_id":"onboarding-multistage-theme-tooltip-dark-2"},"description":{"string_id":"onboarding-multistage-theme-description-dark"}},{"theme":"alpenglow","label":{"string_id":"onboarding-multistage-theme-label-alpenglow"},"tooltip":{"string_id":"onboarding-multistage-theme-tooltip-alpenglow-2"},"description":{"string_id":"onboarding-multistage-theme-description-alpenglow"}}]},"primary_button":{"label":{"string_id":"onboarding-multistage-theme-primary-button-label"},"action":{"navigate":true}},"secondary_button":{"label":{"string_id":"onboarding-multistage-theme-secondary-button-label"},"action":{"theme":"automatic","navigate":true}}}}]}

Control branch (no overrideContent set) should show "make default" that immediately moves on to import (instead of waiting) as per bug 1691145.

Potential treatment A branch that shows pin on first page then make default on second page (also without waiting), so mainly useful for testing that the single pin action works:

{"template":"multistage","screens":[{"id":"AW_PIN_FIREFOX","order":0,"content":{"zap":true,"title":"Pin Firefox to your taskbar","subtitle":{"string_id":"onboarding-multistage-set-default-subtitle"},"primary_button":{"label":"Pin to Taskbar","action":{"navigate":true,"type":"PIN_FIREFOX_TO_TASKBAR"}},"secondary_button":{"label":{"string_id":"onboarding-multistage-set-default-secondary-button-label"},"action":{"navigate":true}},"secondary_button_top":{"text":{"string_id":"onboarding-multistage-welcome-secondary-button-text"},"label":{"string_id":"onboarding-multistage-welcome-secondary-button-label"},"action":{"data":{"entrypoint":"activity-stream-firstrun"},"type":"SHOW_FIREFOX_ACCOUNTS","addFlowParams":true}},"tiles":{"type":"image","source":{"default":"chrome://activity-stream/content/data/content/assets/remote/pin-to-taskbar-v1.svg"}}}},{"id":"AW_SET_DEFAULT","order":1,"content":{"zap":true,"title":{"string_id":"onboarding-multistage-set-default-header"},"subtitle":{"string_id":"onboarding-multistage-set-default-subtitle"},"primary_button":{"label":{"string_id":"onboarding-multistage-set-default-primary-button-label"},"action":{"navigate":true,"type":"SET_DEFAULT_BROWSER"}},"secondary_button":{"label":{"string_id":"onboarding-multistage-set-default-secondary-button-label"},"action":{"navigate":true}}}},{"id":"AW_IMPORT_SETTINGS","order":2,"content":{"zap":true,"help_text":{"text":{"string_id":"onboarding-import-sites-disclaimer"}},"title":{"string_id":"onboarding-multistage-import-header"},"subtitle":{"string_id":"onboarding-multistage-import-subtitle"},"tiles":{"type":"topsites","showTitles":true},"primary_button":{"label":{"string_id":"onboarding-multistage-import-primary-button-label"},"action":{"type":"SHOW_MIGRATION_WIZARD","navigate":true}},"secondary_button":{"label":{"string_id":"onboarding-multistage-import-secondary-button-label"},"action":{"navigate":true}}}},{"id":"AW_CHOOSE_THEME","order":3,"content":{"zap":true,"title":{"string_id":"onboarding-multistage-theme-header"},"subtitle":{"string_id":"onboarding-multistage-theme-subtitle"},"tiles":{"type":"theme","action":{"theme":"<event>"},"data":[{"theme":"automatic","label":{"string_id":"onboarding-multistage-theme-label-automatic"},"tooltip":{"string_id":"onboarding-multistage-theme-tooltip-automatic-2"},"description":{"string_id":"onboarding-multistage-theme-description-automatic-2"}},{"theme":"light","label":{"string_id":"onboarding-multistage-theme-label-light"},"tooltip":{"string_id":"onboarding-multistage-theme-tooltip-light-2"},"description":{"string_id":"onboarding-multistage-theme-description-light"}},{"theme":"dark","label":{"string_id":"onboarding-multistage-theme-label-dark"},"tooltip":{"string_id":"onboarding-multistage-theme-tooltip-dark-2"},"description":{"string_id":"onboarding-multistage-theme-description-dark"}},{"theme":"alpenglow","label":{"string_id":"onboarding-multistage-theme-label-alpenglow"},"tooltip":{"string_id":"onboarding-multistage-theme-tooltip-alpenglow-2"},"description":{"string_id":"onboarding-multistage-theme-description-alpenglow"}}]},"primary_button":{"label":{"string_id":"onboarding-multistage-theme-primary-button-label"},"action":{"navigate":true}},"secondary_button":{"label":{"string_id":"onboarding-multistage-theme-secondary-button-label"},"action":{"theme":"automatic","navigate":true}}}}]}

Potential treatment B branch that shows default browser like control then adds pin on second page:

{"template":"multistage","screens":[{"id":"AW_SET_DEFAULT","order":0,"content":{"zap":true,"title":{"string_id":"onboarding-multistage-set-default-header"},"subtitle":{"string_id":"onboarding-multistage-set-default-subtitle"},"primary_button":{"label":{"string_id":"onboarding-multistage-set-default-primary-button-label"},"action":{"navigate":true,"type":"SET_DEFAULT_BROWSER"}},"secondary_button":{"label":{"string_id":"onboarding-multistage-set-default-secondary-button-label"},"action":{"navigate":true}},"secondary_button_top":{"text":{"string_id":"onboarding-multistage-welcome-secondary-button-text"},"label":{"string_id":"onboarding-multistage-welcome-secondary-button-label"},"action":{"data":{"entrypoint":"activity-stream-firstrun"},"type":"SHOW_FIREFOX_ACCOUNTS","addFlowParams":true}}}},{"id":"AW_PIN_FIREFOX","order":1,"content":{"zap":true,"title":"Pin Firefox to your taskbar","subtitle":{"string_id":"onboarding-multistage-set-default-subtitle"},"primary_button":{"label":"Pin to Taskbar","action":{"navigate":true,"type":"PIN_FIREFOX_TO_TASKBAR"}},"secondary_button":{"label":{"string_id":"onboarding-multistage-set-default-secondary-button-label"},"action":{"navigate":true}},"tiles":{"type":"image","source":{"default":"chrome://activity-stream/content/data/content/assets/remote/pin-to-taskbar-v1.svg"}}}},{"id":"AW_IMPORT_SETTINGS","order":2,"content":{"zap":true,"help_text":{"text":{"string_id":"onboarding-import-sites-disclaimer"}},"title":{"string_id":"onboarding-multistage-import-header"},"subtitle":{"string_id":"onboarding-multistage-import-subtitle"},"tiles":{"type":"topsites","showTitles":true},"primary_button":{"label":{"string_id":"onboarding-multistage-import-primary-button-label"},"action":{"type":"SHOW_MIGRATION_WIZARD","navigate":true}},"secondary_button":{"label":{"string_id":"onboarding-multistage-import-secondary-button-label"},"action":{"navigate":true}}}},{"id":"AW_CHOOSE_THEME","order":3,"content":{"zap":true,"title":{"string_id":"onboarding-multistage-theme-header"},"subtitle":{"string_id":"onboarding-multistage-theme-subtitle"},"tiles":{"type":"theme","action":{"theme":"<event>"},"data":[{"theme":"automatic","label":{"string_id":"onboarding-multistage-theme-label-automatic"},"tooltip":{"string_id":"onboarding-multistage-theme-tooltip-automatic-2"},"description":{"string_id":"onboarding-multistage-theme-description-automatic-2"}},{"theme":"light","label":{"string_id":"onboarding-multistage-theme-label-light"},"tooltip":{"string_id":"onboarding-multistage-theme-tooltip-light-2"},"description":{"string_id":"onboarding-multistage-theme-description-light"}},{"theme":"dark","label":{"string_id":"onboarding-multistage-theme-label-dark"},"tooltip":{"string_id":"onboarding-multistage-theme-tooltip-dark-2"},"description":{"string_id":"onboarding-multistage-theme-description-dark"}},{"theme":"alpenglow","label":{"string_id":"onboarding-multistage-theme-label-alpenglow"},"tooltip":{"string_id":"onboarding-multistage-theme-tooltip-alpenglow-2"},"description":{"string_id":"onboarding-multistage-theme-description-alpenglow"}}]},"primary_button":{"label":{"string_id":"onboarding-multistage-theme-primary-button-label"},"action":{"navigate":true}},"secondary_button":{"label":{"string_id":"onboarding-multistage-theme-secondary-button-label"},"action":{"theme":"automatic","navigate":true}}}}]}

Potential treatment C branch behaves like D above but slightly different text on the first screen:

{"template":"multistage","screens":[{"id":"AW_PIN_AND_DEFAULT","order":0,"content":{"title":"Start by making Firefox a click away","subtitle":"Fast, safe, and private browsing every time you use the web.","help_text":{"position":"default","text":"Make Firefox your main browser"},"primary_button":{"label":"Pin Firefox and Set to Default","action":{"navigate":true,"type":"PIN_AND_DEFAULT","waitForDefault":true}},"secondary_button":{"label":{"string_id":"onboarding-multistage-set-default-secondary-button-label"},"action":{"navigate":true}},"secondary_button_top":{"text":{"string_id":"onboarding-multistage-welcome-secondary-button-text"},"label":{"string_id":"onboarding-multistage-welcome-secondary-button-label"},"action":{"data":{"entrypoint":"activity-stream-firstrun"},"type":"SHOW_FIREFOX_ACCOUNTS","addFlowParams":true}},"waiting_for_default":{"subtitle":"Choose Firefox under Web browser when your settings open","help_text":null,"primary_button":null,"tiles":{"media_type":"tiles-delayed","type":"image","source":{"default":"chrome://activity-stream/content/data/content/assets/remote/windows-default-browser.gif"}}}}},{"id":"AW_IMPORT_SETTINGS","order":1,"content":{"zap":true,"help_text":{"text":{"string_id":"onboarding-import-sites-disclaimer"}},"title":{"string_id":"onboarding-multistage-import-header"},"subtitle":{"string_id":"onboarding-multistage-import-subtitle"},"tiles":{"type":"topsites","showTitles":true},"primary_button":{"label":{"string_id":"onboarding-multistage-import-primary-button-label"},"action":{"type":"SHOW_MIGRATION_WIZARD","navigate":true}},"secondary_button":{"label":{"string_id":"onboarding-multistage-import-secondary-button-label"},"action":{"navigate":true}}}},{"id":"AW_CHOOSE_THEME","order":2,"content":{"zap":true,"title":{"string_id":"onboarding-multistage-theme-header"},"subtitle":{"string_id":"onboarding-multistage-theme-subtitle"},"tiles":{"type":"theme","action":{"theme":"<event>"},"data":[{"theme":"automatic","label":{"string_id":"onboarding-multistage-theme-label-automatic"},"tooltip":{"string_id":"onboarding-multistage-theme-tooltip-automatic-2"},"description":{"string_id":"onboarding-multistage-theme-description-automatic-2"}},{"theme":"light","label":{"string_id":"onboarding-multistage-theme-label-light"},"tooltip":{"string_id":"onboarding-multistage-theme-tooltip-light-2"},"description":{"string_id":"onboarding-multistage-theme-description-light"}},{"theme":"dark","label":{"string_id":"onboarding-multistage-theme-label-dark"},"tooltip":{"string_id":"onboarding-multistage-theme-tooltip-dark-2"},"description":{"string_id":"onboarding-multistage-theme-description-dark"}},{"theme":"alpenglow","label":{"string_id":"onboarding-multistage-theme-label-alpenglow"},"tooltip":{"string_id":"onboarding-multistage-theme-tooltip-alpenglow-2"},"description":{"string_id":"onboarding-multistage-theme-description-alpenglow"}}]},"primary_button":{"label":{"string_id":"onboarding-multistage-theme-primary-button-label"},"action":{"navigate":true}},"secondary_button":{"label":{"string_id":"onboarding-multistage-theme-secondary-button-label"},"action":{"theme":"automatic","navigate":true}}}}]}
Flags: needinfo?(tspurway) → needinfo?(mcoman)
See Also: → 1691145
Blocks: 1694257
See Also: → 1694259

I have verified this enhancement and I can confirm that the functionality of pinning/unpinning and settings the browser default/non-default using the five versions of about:welcome is as described. Also, we will perform a more thoughtfully testing round in the Firefox 87 Pre-Release phase which will conclude with a testing report.

Flags: needinfo?(mcoman)

This issue was verified as part of the work done on PI-963 which concluded with a Testing Report that you can see here.
Considering the above, I'm marking this issue as VERIFIED.

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