A quirk of the JavaScript implementation of XPCOM's QueryInterface is that it loads the interface's functions onto the queried object. For Services like `ShellService` this creates situations where the interface can be initialized at a distance, causing races depending on how Firefox is run - e.g. Desktop vs Background Task. To ensure consistent behavior this patch forces `ShellService` initialization of the native interface so that the native functions are always present.
To accomplish this, `nsIWindowsShellService` has been modified to inherit from `nsIShellService` to match other platforms and ensure that querying it also loads the `nsIShellService` members into `shellService`.
Differential Revision: https://phabricator.services.mozilla.com/D222154