Open Bug 1950899 Opened 10 months ago Updated 4 months ago

Figure out how to use moz-src for Policies.sys.mjs and schema.sys.mjs

Categories

(Firefox :: Enterprise Policies, task, P5)

task

Tracking

()

People

(Reporter: Gijs, Unassigned)

References

(Blocks 1 open bug)

Details

We currently use resource:///modules/policies/Policies.sys.mjs to load this module (and resource:///modules/policies/schemas/schema.sys.mjs to load the other, here and here). This is effectively a kind of indirection mechanism so that Firefox and Thunderbird can provide their own policies. This means we cannot "just" switch it to moz-src as there are multiple implementations and so not 1 source location where each module lives.

There is no real urgency in figuring this out, I am simply documenting this so it's obvious these modules cannot "just" be converted to moz-src.

The most plausible way around this that I can see off-hand is introducing some indirection in how these modules are accessed or loaded, like using the category manager, XPCOM service registration (contract ID), a preference, or some other one-vertex-removed way of finding our way from the toolkit code to the app-specific code. Only the XPCOM route would provide some way of doing type checks across modules - but it's also more costly in terms of having to define more "glue" to bind the two layers together. We could also accept hardcoding some if/else statements and sourcing specific code modules based on which app we're running, although that is not the cleanest in terms of future maintainability / potential other consumers / etc.

Type: defect → task
Summary: Figure out how to use moz-src for Policies.sys.mjs → Figure out how to use moz-src for Policies.sys.mjs and schema.sys.mjs

Most, but not all, of what the module does is not app-specific (for Thunderbird it's more of a catch-up-with-Firefox's version situation). If it gets refactored somehow, perhaps there could be a base impl in toolkit/ that each app could then extend for app-specific needs.

(In reply to Magnus Melin [:mkmelin] from comment #1)

Most, but not all, of what the module does is not app-specific (for Thunderbird it's more of a catch-up-with-Firefox's version situation). If it gets refactored somehow, perhaps there could be a base impl in toolkit/ that each app could then extend for app-specific needs.

That could also be a good option - Integration.sys.mjs may be able to help with this.

Severity: -- → N/A
Priority: -- → P5
You need to log in before you can comment on or make changes to this bug.