Back to the original subject of this thread, digging through Firefox source code turned up something interesting:
barbaz wrote: ↑Sun Oct 27, 2024 5:58 pm
manually requesting immediate suspend of the background script.
Turns out that in about:debugging,
for Temporary extensions, there is a button to "Terminate background script".
But this is only available for temporary extensions. I could not find this option because I was installing test extensions the normal way, running the browser in a disposable sandbox that gets dumped on quit and only installing the test extension in the disposable-sandboxed browser instance.
Looks like temporary extensions can be installed from xpi, and installing a temporary extension "on top of" the permanent one looks to work the same as with the normal install method
barbaz wrote: ↑Sun Oct 27, 2024 5:58 pm
The reason to only "request" suspend is because of this:
... so testing this properly requires
not forcing suspend in situations where an automatic suspend attempt would have been cancelled.
Not sure if the button maybe more forceful than automatic suspend in this way, but the fact there is a UI for this (as opposed to needing to write code in the Browser Console) would seem to indicate that any such differences, if any, are likely unimportant for testing.