Closed Bug 1879975 Opened 3 months ago Closed 25 days ago

Firefox pinning to taskbar on newer versions of Windows fails

Categories

(Firefox :: Shell Integration, defect, P2)

x86_64
Windows
defect

Tracking

()

RESOLVED FIXED
127 Branch
Tracking Status
firefox127 --- fixed

People

(Reporter: michaelahughesuk, Assigned: michaelahughesuk)

References

(Depends on 2 open bugs, Blocks 2 open bugs)

Details

Attachments

(3 files, 2 obsolete files)

On newer versions of Windows (first seen in version 10.0.26052.1100), Firefox is unable to pin to the taskbar.

Found in

FX 123

Affected versions

All versions with pinning to the taskbar

Tested platforms

Affected platforms: Windows 10x64
Unaffected platforms: macOS 13, Ubuntu 22.1, Windows 11

Preconditions

Unpin Firefox from the taskbar and make sure that another browser is the system default browser. Close all instances of Firefox.

Steps to reproduce

Launch Firefox. Click yes on the prompt to make Firefox the default browser and pin it to the taskbar.

Expected result

Firefox is pinned to the taskbar

Actual result

Fire is NOT pinned to the taskbar and the user gets no feedback explaining that it isn't pinned.

Regression range

Not a regression

Additional notes

Happens since pinning was introduced into the installer, and only on newer versions of Windows.
Assignee: nobody → mhughes
Status: NEW → ASSIGNED

This is adding in the new Windows 11 only version of taskbar pinning. For the new pinning to work, we need to use limited access feature tokens. Those are going to be made private and aren't included with this change.
This change will compile, and will work if built against the correct limited access feature tokens, as specified in developer local machine config files, but for every other build, the new taskbar pinning won't work and will fall back to the old methods.
I will implement the try / release building machines using the secret limited access feature tokens in a follow-up diff.

Added new secret data storing the release keys. Modifying scripts to hook them up. Testing will be done thoroughly with try and release builds to confirm that pinning works on newer machines and falls back to the old mechanism on older machines.

Depends on D205004

Blocks: 1890634
Pushed by mhughes@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f9aa23ba9fde
Newer versions of Windows disable pinning to the taskbar using older methods r=mpohle,bhearsum,nrishel
https://hg.mozilla.org/integration/autoland/rev/c3ab151d75bd
Hooking up secret keys with try and release builds for new windows api taskbar pinning r=bhearsum,taskgraph-reviewers,ahal
https://hg.mozilla.org/integration/autoland/rev/e66749b7e244
Adding in logging for taskbar debugging r=nrishel,mpohle
Regressions: 1890707
Pushed by mhughes@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/9bcec32fe1ac
Newer versions of Windows disable pinning to the taskbar using older methods r=mpohle,bhearsum,nrishel
https://hg.mozilla.org/integration/autoland/rev/e51e76ec89c5
Hooking up secret keys with try and release builds for new windows api taskbar pinning r=bhearsum,taskgraph-reviewers,ahal
https://hg.mozilla.org/integration/autoland/rev/59dafb79d2be
Adding in logging for taskbar debugging r=nrishel,mpohle

This should be fixed in FX126 now, assuming my code changes don't get reverted for any reason.
With my changes, pinning works now sometimes on the newest beta channel of Windows. Note that private-browsing can't be pinned and no other pins work unless done manually by the user right clicking on an icon in the taskbar and choosing to pin it.

Sometimes, pinning still does not work. It appears that trying to pin too many times, or pinning too quickly on start up of Firefox results in pinning failing and no error reported to the user. On one occasion, pinning from Firefox would not work again until I restarted my computer.

To trigger pinning, go to about:welcome, ensure that "Pin _____ to taskbar" is checked, and hit the "Save and Continue" button.

To test these new changes, a couple of scenarios have to be verified as working.

  1. Confirm that pinning continues to work on older versions of Windows. To verify, attempt to pin through about:welcome with Firefox 125 and if that works, run FX 126 and confirm that pinning still works.

  2. Confirm that pinning works on newer versions of Windows. Right now, that is probably just the beta or developer / canary builds of Windows. If running those, confirm you're on a version that blocks the old pinning mechanism. Run FX 125 and attempt to pin by about:welcome. If pinning fails, you are on a version of Windows that blocks the old mechanism. Now run FX 126 and confirm that pinning from about:welcome does work. It should pop up a system confirmation box in the bottom right. See the attached image.

Since this wasn't working for me occasionally, testing on different machines, and pinning quickly after startup or waiting, and doing it many times, would be helpful to narrow down how often it breaks for others.

Flags: needinfo?(mhughes)
Attached image pinning_popup.png
Pushed by mhughes@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b2f6d0289dc6
Newer versions of Windows disable pinning to the taskbar using older methods r=mpohle,bhearsum,nrishel,glandium
https://hg.mozilla.org/integration/autoland/rev/be268309f0f7
Hooking up secret keys with try and release builds for new windows api taskbar pinning r=bhearsum,taskgraph-reviewers,ahal
https://hg.mozilla.org/integration/autoland/rev/5e5bc998487f
Adding in logging for taskbar debugging r=nrishel,mpohle

Backed out for causing bustage while fetching windows-laf-tokens.data

[task 2024-04-12T20:48:50.939Z] 20:48:50     INFO - fetching secret project/releng/gecko/build/windows-laf-tokens.data from API
[task 2024-04-12T20:48:50.998Z] 20:48:50     INFO - [mozharness: 2024-04-12 20:48:50.998203Z] Finished get-secrets step (failed)
[task 2024-04-12T20:48:50.999Z] 20:48:50    FATAL - Uncaught exception: Traceback (most recent call last):
[task 2024-04-12T20:48:50.999Z] 20:48:50    FATAL -   File "/builds/worker/checkouts/gecko/testing/mozharness/mozharness/base/script.py", line 2384, in run
[task 2024-04-12T20:48:50.999Z] 20:48:50    FATAL -     self.run_action(action)
[task 2024-04-12T20:48:50.999Z] 20:48:50    FATAL -   File "/builds/worker/checkouts/gecko/testing/mozharness/mozharness/base/script.py", line 2318, in run_action
[task 2024-04-12T20:48:50.999Z] 20:48:50    FATAL -     self._possibly_run_method(method_name, error_if_missing=True)
[task 2024-04-12T20:48:50.999Z] 20:48:50    FATAL -   File "/builds/worker/checkouts/gecko/testing/mozharness/mozharness/base/script.py", line 2270, in _possibly_run_method
[task 2024-04-12T20:48:50.999Z] 20:48:50    FATAL -     return getattr(self, method_name)()
[task 2024-04-12T20:48:50.999Z] 20:48:50    FATAL -   File "/builds/worker/checkouts/gecko/testing/mozharness/mozharness/mozilla/secrets.py", line 77, in get_secrets
[task 2024-04-12T20:48:50.999Z] 20:48:50    FATAL -     secret = self._fetch_secret(secret_name)
[task 2024-04-12T20:48:50.999Z] 20:48:50    FATAL -   File "/builds/worker/checkouts/gecko/testing/mozharness/mozharness/mozilla/secrets.py", line 26, in _fetch_secret
[task 2024-04-12T20:48:50.999Z] 20:48:50    FATAL -     res = urllib.request.urlopen(url)
[task 2024-04-12T20:48:50.999Z] 20:48:50    FATAL -   File "/builds/worker/fetches/python/lib/python3.8/urllib/request.py", line 222, in urlopen
[task 2024-04-12T20:48:50.999Z] 20:48:50    FATAL -     return opener.open(url, data, timeout)
[task 2024-04-12T20:48:50.999Z] 20:48:50    FATAL -   File "/builds/worker/fetches/python/lib/python3.8/urllib/request.py", line 531, in open
[task 2024-04-12T20:48:50.999Z] 20:48:50    FATAL -     response = meth(req, response)
[task 2024-04-12T20:48:50.999Z] 20:48:50    FATAL -   File "/builds/worker/fetches/python/lib/python3.8/urllib/request.py", line 640, in http_response
[task 2024-04-12T20:48:50.999Z] 20:48:50    FATAL -     response = self.parent.error(
[task 2024-04-12T20:48:50.999Z] 20:48:50    FATAL -   File "/builds/worker/fetches/python/lib/python3.8/urllib/request.py", line 569, in error
[task 2024-04-12T20:48:50.999Z] 20:48:50    FATAL -     return self._call_chain(*args)
[task 2024-04-12T20:48:50.999Z] 20:48:50    FATAL -   File "/builds/worker/fetches/python/lib/python3.8/urllib/request.py", line 502, in _call_chain
[task 2024-04-12T20:48:50.999Z] 20:48:50    FATAL -     result = func(*args)
[task 2024-04-12T20:48:50.999Z] 20:48:50    FATAL -   File "/builds/worker/fetches/python/lib/python3.8/urllib/request.py", line 649, in http_error_default
[task 2024-04-12T20:48:50.999Z] 20:48:50    FATAL -     raise HTTPError(req.full_url, code, msg, hdrs, fp)
[task 2024-04-12T20:48:50.999Z] 20:48:50    FATAL - urllib.error.HTTPError: HTTP Error 403: Forbidden
[task 2024-04-12T20:48:50.999Z] 20:48:50    FATAL - Running post_fatal callback...
[task 2024-04-12T20:48:50.999Z] 20:48:50    ERROR - setting return code to 2 because fatal was called
[task 2024-04-12T20:48:50.999Z] 20:48:50  WARNING - setting return code to 2
[task 2024-04-12T20:48:50.999Z] 20:48:50    FATAL - Exiting -1
Flags: needinfo?(mhughes)
Pushed by mhughes@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e04956da20c6
Newer versions of Windows disable pinning to the taskbar using older methods r=mpohle,bhearsum,nrishel,glandium
https://hg.mozilla.org/integration/autoland/rev/d9a53dc2478c
Hooking up secret keys with try and release builds for new windows api taskbar pinning r=bhearsum,taskgraph-reviewers,ahal
https://hg.mozilla.org/integration/autoland/rev/5eee9358d22a
Adding in logging for taskbar debugging r=nrishel,mpohle
Pushed by mhughes@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/af2eee38668d
Newer versions of Windows disable pinning to the taskbar using older methods r=mpohle,bhearsum,nrishel,glandium
https://hg.mozilla.org/integration/autoland/rev/cfc40111608f
Hooking up secret keys with try and release builds for new windows api taskbar pinning r=bhearsum,taskgraph-reviewers,ahal
https://hg.mozilla.org/integration/autoland/rev/5f362eae55c5
Adding in logging for taskbar debugging r=nrishel,mpohle

This is an extreme short term fix to avoid https://bugzilla.mozilla.org/show_bug.cgi?id=1879975 getting backed out again. I will be following up in the next few days with a removal of this scope from l10n (and some other jobs) in https://bugzilla.mozilla.org/show_bug.cgi?id=1890359, after adjusting some mozconfigs.

Pushed by bhearsum@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/280d7a1f6adc
allow l10n jobs to access windows laf secrets r=releng-reviewers,taskgraph-reviewers,hneiva
Regressions: 1892220

.

Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Target Milestone: 127 Branch → ---
Attachment #9392575 - Attachment is obsolete: true
Pushed by mhughes@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a002fbdcd4b2
Newer versions of Windows disable pinning to the taskbar using older methods r=mpohle,bhearsum,nrishel,glandium,nalexander
https://hg.mozilla.org/integration/autoland/rev/31fc12d4ea4e
Adding in logging for taskbar debugging r=nrishel,mpohle
Status: REOPENED → RESOLVED
Closed: 1 month ago25 days ago
Resolution: --- → FIXED
Target Milestone: --- → 127 Branch

Repeating and modifying Comment #8 above:

This is fixed in FX127 now.

With my changes, pinning works now sometimes on the newest beta channel of Windows. Note that private-browsing can't be pinned and no other pins work unless done manually by the user right clicking on an icon in the taskbar and choosing to pin it.

Sometimes, pinning still does not work. It appears that trying to pin too many times, or pinning too quickly on start up of Firefox results in pinning failing and no error reported to the user. On one occasion, pinning from Firefox would not work again until I restarted my computer.

To trigger pinning, go to about:welcome, ensure that "Pin _____ to taskbar" is checked, and hit the "Save and Continue" button.

To test these new changes, a couple of scenarios have to be verified as working.

Case 1: confirm that pinning continues to work on older versions of Windows (testing on Windows 22H2 or even 23H2 should be sufficient). To verify, attempt to pin through about:welcome with Firefox 125 and if that works, run the version of Firefox with the fixes (127) and confirm that pinning still works.

Case 2: confirm that pinning works on newer versions of Windows. Right now, that is probably just the beta or developer / canary builds of Windows. If running those, confirm you're on a version that blocks the old pinning mechanism. Run FX 125 and attempt to pin by about:welcome. If pinning fails, you are on a version of Windows that blocks the old mechanism. Now run the newer, fixed version of Firefox (FX 127) and confirm that pinning from about:welcome does work. It should pop up a system confirmation box in the bottom right. See the attached image.

Since this wasn't working for me occasionally, testing on different machines, and pinning quickly after startup or waiting, and doing it many times, would be helpful to narrow down how often it breaks for others.

Also note that the changes are so far only showing up on unreleased versions of Windows 11, so testing on Windows 10 does not have to be too thorough, other than to confirm that pinning still works as expected. To repo the problem case of tab pinning not working with older versions of Firefox (< FX126), I'm seeing it in Windows 11 24H2, OS Build: 26100.1 and I don't believe it's happening on generally available, released versions of Windows.

Flags: needinfo?(mhughes)

Adding a comment here to explain that I'm specifically not requesting uplift on this change because as far as we know, Microsoft has only disabled taskbar pinning using pre-Firefox 127 methods on Insider program versions of Windows. The vast majority of our users are not using Insider program builds of Windows, so it's better not to introduce new changes to FX126 this late in the release cycle.

Depends on: 1893458
Depends on: 1893431
Depends on: 1893654
Blocks: 1894081
Attachment #9397279 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: