Open Bug 1829423 Opened 2 years ago Updated 1 month ago

Figure out a way to launch background task without getting a macOS dock icon

Categories

(Toolkit :: Background Tasks, task, P3)

task

Tracking

()

People

(Reporter: saschanaz, Unassigned)

References

(Blocks 1 open bug)

Details

plugin-container was suggested but it requires more from the main process and thus not really independent.

Summary: Figure out a way to launch background task without getting a dock icon → Figure out a way to launch background task without getting a macOS dock icon
See Also: → 1827486
Priority: -- → P3

This came up on Matrix recently.

Looking at the macOS entitlements, I'd rather run macOS background tasks as the plugin container, which has basically JIT pages and nothing else. Background tasks don't need the things in https://searchfox.org/mozilla-central/source/security/mac/hardenedruntime/v2/production/firefox.browser.xml (except perhaps PKCS11 moduels, in special circumstances).

Per :nika:

This is plugin-container's main function entry point: https://searchfox.org/mozilla-central/rev/488d81581a9142d532bf814efa60564ff11599ca/ipc/app/MozillaRuntimeMain.cpp#27, and it's built with linkage="dependent" (https://searchfox.org/mozilla-central/rev/488d81581a9142d532bf814efa60564ff11599ca/ipc/app/moz.build#13).

In contrast, the main firefox app uses this main: https://searchfox.org/mozilla-central/rev/488d81581a9142d532bf814efa60564ff11599ca/browser/app/nsBrowserApp.cpp#282, which is built with "standalone" linkage (https://searchfox.org/mozilla-central/rev/488d81581a9142d532bf814efa60564ff11599ca/browser/app/moz.build#35,44).

One of the main differences is that when building the main firefox app, code to start both a content process and the main process is present (and content processes receive an extra -contentproc argument), whereas for plugin-container, only the content process code is present.

The extra argument is added in the launching code here (https://searchfox.org/mozilla-central/rev/488d81581a9142d532bf814efa60564ff11599ca/ipc/glue/GeckoChildProcessHost.cpp#1267), and here (https://searchfox.org/mozilla-central/rev/488d81581a9142d532bf814efa60564ff11599ca/ipc/glue/GeckoChildProcessHost.cpp#1570).

You need to log in before you can comment on or make changes to this bug.