Handlers unresolvable MIME type prevents later handler entries from being processed
Categories
(Enterprise Products :: Firefox, defect)
Tracking
(firefox-esr153 fixed, firefox157 fixed)
People
(Reporter: bsmth, Assigned: mkaply)
References
Details
Attachments
(1 file, 2 external files)
|
77.11 KB,
image/png
|
Details |
Handlers.onBeforeAddons wraps extensions in try/catch but not the 'mimeTypes', so an unresolvable MIME type throws out of the whole callback and discards every later mimeTypes entry plus the extensions and schemes blocks.
STR:
Given a policy with this shape:
{
"policies": {
"Handlers": {
"mimeTypes": { "": { "action": "saveToDisk" } },
"extensions": { "": { "action": "saveToDisk" } }
}
}
}
Expectation: the mimeTypes key is skipped with a diagnostic naming it, the rest of the policy applies, exactly as the extensions branch already behaves.
Actual: No warning about Invalid file extension, so the extensions section never ran, it's discarded.
An empty string is the smallest trigger, but any MIME type the service cannot resolve does this.
Updated•2 months ago
|
| Assignee | ||
Comment 1•2 months ago
|
||
Comment 3•2 months ago
|
||
| bugherder | ||
Updated•2 months ago
|
Updated•2 months ago
|
Comment 5•2 months ago
|
||
I will set up a herald rule to watch this file so that I can keep ahead of changes and hopefully even avoid thr test failures. But this is great to see things are working to keep us in sync!
| Reporter | ||
Updated•2 months ago
|
Hello,
I checked this today on Windows 11, using Nightly 157.0a1 (20260908080322), and specific errors are now displayed in about:policies.
Is this the expected result for the fix made in this ticket?
Thank you.
Hello,
I checked this today on Windows 11, using Nightly 157.0a1 (20260908080322), and specific errors are now displayed in about:policies.
Is this the expected result for the fix made in this ticket?
Thank you.
| Reporter | ||
Comment 8•2 months ago
|
||
Yes, thanks. Nightly reports both problems - the second one confirms that processing continued into the extensions block instead of stopping at the invalid MIME type.
| Assignee | ||
Comment 10•1 month ago
|
||
Original Revision: https://phabricator.services.mozilla.com/D321971
(cherry picked from commit 674ab89622d796e216e1d41b5a5ff7e4bfc62d51)
Rebased for ESR 153: the helper functions moved to
toolkit/components/enterprisepolicies/PoliciesHelpers.sys.mjs in Bug 2048572,
which is not on ESR 153. The processMIMEInfo change is applied in its
pre-refactor location in browser/components/enterprisepolicies/Policies.sys.mjs
and the lazy.processMIMEInfo call sites are unprefixed accordingly.
Updated•1 month ago
|
Updated•1 month ago
|
Updated•1 month ago
|
Comment 11•1 month ago
|
||
| uplift | ||
Description
•