1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #include
"nsISupports.idl"
10 // Simple C++ getter for nsIXULRuntime::browserTabsRemoteAutostart
11 // This getter is a temporary function that checks for special
12 // conditions in which e10s support is not great yet, and should
13 // therefore be disabled. Bug 1065561 tracks its removal.
14 bool BrowserTabsRemoteAutostart
();
15 uint32_t GetMaxWebProcessCount
();
17 // Returns the value of the fission.autostart pref. Since fission can be
18 // disabled on a per-window basis, this should only be used when you need the
19 // global value of the pref. For other use cases, you should use
20 // nsILoadContext::UseRemoteSubframes instead. This will also check for special
21 // conditions, like safe mode, which may require fission to be disabled, or
22 // environment variables MOZ_FORCE_ENABLE_FISSION and MOZ_FORCE_DISABLE_FISSION,
23 // used by mach run to enable/disable fission regardless of pref settings.
24 bool FissionAutostart
();
26 // Returns whether or not we are currently enrolled in the fission experiment.
27 bool FissionExperimentEnrolled
();
29 // Returns true if FissionAutostart() is true or
30 // fission.disableSessionHistoryInParent is false.
31 bool SessionHistoryInParent
();
33 // Returns true if SessionHistoryInParent() is true and
34 // browser.sessionstore.disable_platform_collection is false.
35 bool SessionStorePlatformCollection
();
37 // Returns true if SessionHistoryInParent() returns true and
38 // fission.bfcacheInParent is true.
39 bool BFCacheInParent
();
45 * Provides information about the XUL runtime.
46 * @status UNSTABLE - This interface is not frozen and will probably change in
47 * future releases. If you need this functionality to be
48 * stable/frozen, please contact Benjamin Smedberg.
51 [scriptable
, uuid(03602fac
-fa3f
-4a50
-9baa
-b88456fb4a0f
)]
52 interface nsIXULRuntime
: nsISupports
55 * Whether the application was launched in safe mode.
57 readonly attribute
boolean inSafeMode
;
60 * The status of a given normandy experiment.
62 cenum ExperimentStatus
: 8 {
63 // The user is not actively enrolled in the experiment.
64 eExperimentStatusUnenrolled
= 0,
65 // The user is enrolled in the control group, and should see the default
67 eExperimentStatusControl
= 1,
68 // The user is enrolled in the treatment group, and should see the
69 // experimental behavior which is being tested.
70 eExperimentStatusTreatment
= 2,
71 // The user was enrolled in the experiment, but became ineligible due to
72 // manually modifying a relevant preference.
73 eExperimentStatusDisqualified
= 3,
74 // The user was selected for the phased Fission rollout.
75 eExperimentStatusRollout
= 4,
77 eExperimentStatusCount
,
80 // If you update this enum, don't forget to raise the limit in
81 // TelemetryEnvironmentTesting.sys.mjs and record the new value in
83 cenum ContentWin32kLockdownState
: 8 {
84 LockdownEnabled
= 1, // no longer used
86 OperatingSystemNotSupported
= 3,
87 PrefNotSet
= 4, // no longer used
88 MissingRemoteWebGL
= 5,
89 MissingNonNativeTheming
= 6,
90 DisabledByEnvVar
= 7, // - MOZ_ENABLE_WIN32K is set
91 DisabledBySafeMode
= 8,
92 DisabledByE10S
= 9, // - E10S is disabled for whatever reason
93 DisabledByUserPref
= 10, // - The user manually set
94 // security.sandbox.content.win32k-disable to false
95 EnabledByUserPref
= 11, // The user manually set
96 // security.sandbox.content.win32k-disable to true
97 DisabledByControlGroup
=
98 12, // The user is in the Control Group, so it is disabled
99 EnabledByTreatmentGroup
=
100 13, // The user is in the Treatment Group, so it is enabled
101 DisabledByDefault
= 14, // The default value of the pref is false
102 EnabledByDefault
= 15, // The default value of the pref is true
103 DecodersArentRemote
= 16,
104 IncompatibleMitigationPolicy
= 17, // Some incompatible Windows Exploit Mitigation policies are enabled
107 // This is the current value of the experiment for the session
108 readonly attribute nsIXULRuntime_ExperimentStatus win32kExperimentStatus
;
109 // This will return what the browser thinks is the _current_ status of win32k lockdown
110 // but this should only be used for testing
111 readonly attribute nsIXULRuntime_ContentWin32kLockdownState win32kLiveStatusTestingOnly
;
112 // This is the current value of win32k lockdown for the session. It is set at startup,
113 // and never changed.
114 readonly attribute nsIXULRuntime_ContentWin32kLockdownState win32kSessionStatus
;
116 // NOTE: Please do not add new values to this enum without also updating the
117 // mapping in aboutSupport.js
118 cenum FissionDecisionStatus
: 8 {
119 eFissionStatusUnknown
= 0,
120 // Fission is disabled because the user is in the control group of a
121 // Normandy experiment.
122 eFissionExperimentControl
= 1,
123 // Fission is enabled because the user is in the treatment group of a
124 // Normandy experiment.
125 eFissionExperimentTreatment
= 2,
126 // Fission is disabled because the `MOZ_FORCE_DISABLE_E10S` environment
128 eFissionDisabledByE10sEnv
= 3,
129 // Fission is enabled because the `MOZ_FORCE_ENABLE_FISSION` environment
131 eFissionEnabledByEnv
= 4,
132 // Fission is disabled because the `MOZ_FORCE_DISABLE_FISSION` environment
134 eFissionDisabledByEnv
= 5,
135 // Fission is enabled because the "fission.autostart" preference is true
137 eFissionEnabledByDefault
= 7,
138 // Fission is disabled because the "fission.autostart" preference is false
140 eFissionDisabledByDefault
= 8,
141 // Fission is enabled because the "fission.autostart" preference was
142 // turned on by the user.
143 eFissionEnabledByUserPref
= 9,
144 // Fission is enabled because the "fission.autostart" preference was
145 // turned on by the user.
146 eFissionDisabledByUserPref
= 10,
147 // Fission is disabled because e10s is disabled for some other reason.
148 eFissionDisabledByE10sOther
= 11,
149 // Fission is enabled by a Normandy phased rollout.
150 eFissionEnabledByRollout
= 12,
154 * Whether Fission should be automatically enabled for new browser windows.
155 * This may not match the value of the 'fission.autostart' pref.
157 * This value is guaranteed to remain constant for the length of a browser
160 readonly attribute
boolean fissionAutostart
;
163 * The deciding factor which caused Fission to be enabled or disabled in
164 * this session. The string version is the same of the name of the constant,
165 * without the leading `eFission`, and with an initial lower-case letter.
167 readonly attribute nsIXULRuntime_FissionDecisionStatus fissionDecisionStatus
;
168 readonly attribute ACString fissionDecisionStatusString
;
171 * Whether session history is stored in the parent process.
173 readonly attribute
boolean sessionHistoryInParent
;
176 * Whether Gecko code drives session store collection data.
178 readonly attribute
boolean sessionStorePlatformCollection
;
181 * Whether to write console errors to a log file. If a component
182 * encounters startup errors that might prevent the app from showing
183 * proper UI, it should set this flag to "true".
185 attribute
boolean logConsoleErrors
;
188 * A string tag identifying the current operating system. This is taken
189 * from the OS_TARGET configure variable. It will always be available.
191 readonly attribute AUTF8String OS
;
194 * A string tag identifying the binary ABI of the current processor and
195 * compiler vtable. This is taken from the TARGET_XPCOM_ABI configure
196 * variable. It may not be available on all platforms, especially
197 * unusual processor or compiler combinations.
199 * The result takes the form <processor>-<compilerABI>, for example:
203 * This value should almost always be used in combination with "OS".
205 * @throw NS_ERROR_NOT_AVAILABLE if not available.
207 readonly attribute AUTF8String XPCOMABI
;
210 * A string tag identifying the target widget toolkit in use.
211 * This is taken from the MOZ_WIDGET_TOOLKIT configure variable.
213 readonly attribute AUTF8String widgetToolkit
;
216 * The legal values of processType.
218 const unsigned long PROCESS_TYPE_DEFAULT
= 0;
219 const unsigned long PROCESS_TYPE_CONTENT
= 2;
220 const unsigned long PROCESS_TYPE_IPDLUNITTEST
= 3;
221 const unsigned long PROCESS_TYPE_GMPLUGIN
= 4;
222 const unsigned long PROCESS_TYPE_GPU
= 5;
223 const unsigned long PROCESS_TYPE_VR
= 6;
224 const unsigned long PROCESS_TYPE_RDD
= 7;
225 const unsigned long PROCESS_TYPE_SOCKET
= 8;
226 const unsigned long PROCESS_TYPE_REMOTESANDBOXBROKER
= 9;
227 const unsigned long PROCESS_TYPE_FORKSERVER
= 10;
228 const unsigned long PROCESS_TYPE_UTILITY
= 11;
231 * The type of the caller's process. Returns one of the values above.
233 readonly attribute
unsigned long processType
;
236 * The system process ID of the caller's process.
238 readonly attribute
unsigned long processID
;
241 * A globally unique and non-recycled ID of the caller's process.
243 readonly attribute uint64_t uniqueProcessID
;
246 * The type of remote content process we're running in.
247 * null if we're in the parent/chrome process. This can contain
248 * a URI if Fission is enabled, so don't use it for any kind of
251 readonly attribute AUTF8String remoteType
;
254 * If true, browser tabs may be opened by default in a different process
255 * from the main browser UI.
257 readonly attribute
boolean browserTabsRemoteAutostart
;
260 * Returns the number of content processes to use for normal web pages. If
261 * this value is > 1, then e10s-multi should be considered to be "on".
263 * NB: If browserTabsRemoteAutostart is false, then this value has no
264 * meaning and e10s should be considered to be "off"!
266 readonly attribute uint32_t maxWebProcessCount
;
269 * The current e10s-multi experiment number. Set dom.ipc.multiOptOut to (at
270 * least) this to disable it until the next experiment.
272 const uint32_t E10S_MULTI_EXPERIMENT
= 1;
275 * If true, the accessibility service is running.
277 readonly attribute
boolean accessibilityEnabled
;
280 * Executable of Windows service that activated accessibility.
282 readonly attribute AString accessibilityInstantiator
;
285 * Indicates whether the current Firefox build is 64-bit.
287 readonly attribute
boolean is64Bit
;
290 * Indicates whether or not text recognition of images supported by the OS.
292 readonly attribute
boolean isTextRecognitionSupported
;
295 * Signal the apprunner to invalidate caches on the next restart.
296 * This will cause components to be autoregistered and all
297 * fastload data to be re-created.
299 void invalidateCachesOnRestart
();
302 * Starts a child process. This method is intented to pre-start a
303 * content child process so that when it is actually needed, it is
306 * @throw NS_ERROR_NOT_AVAILABLE if not available.
308 void ensureContentProcess
();
311 * Modification time of the profile lock before the profile was locked on
312 * this startup. Used to know the last time the profile was used and not
313 * closed cleanly. This is set to 0 if there was no existing profile lock.
315 readonly attribute PRTime replacedLockTime
;
318 * The default update channel (MOZ_UPDATE_CHANNEL).
320 readonly attribute AUTF8String defaultUpdateChannel
;
323 * The distribution ID for this build (MOZ_DISTRIBUTION_ID).
325 readonly attribute AUTF8String distributionID
;
328 * True if Windows DLL blocklist initialized correctly. This is
329 * primarily for automated testing purposes.
331 readonly attribute
boolean windowsDLLBlocklistStatus
;
334 * True if this application was started by the OS as part of an automatic
335 * restart mechanism (such as RegisterApplicationRestart on Windows).
337 readonly attribute
boolean restartedByOS
;
339 /** Whether the chrome color-scheme is dark */
340 readonly attribute
boolean chromeColorSchemeIsDark
;
342 /** Whether the content color-scheme derived from the app theme is dark */
343 readonly attribute
boolean contentThemeDerivedColorSchemeIsDark
;
345 /** Whether the user prefers reduced motion */
346 readonly attribute
boolean prefersReducedMotion
;
348 /** Whether we should draw over the titlebar */
349 readonly attribute
boolean drawInTitlebar
;
351 /** Returns the desktop environment identifier. Only meaningful on GTK */
352 readonly attribute ACString desktopEnvironment
;
354 /** Whether we use Wayland. Only meaningful on GTK */
355 readonly attribute
boolean isWayland
;
358 * The path of the shortcut used to start the current process, or "" if none.
360 * Windows Main process only, otherwise throws NS_ERROR_NOT_AVAILABLE
362 * May be mising in some cases where the user did launch from a shortcut:
363 * - If the updater ran on startup
364 * - If the AUMID was set before the shortcut could be saved
366 * @throw NS_ERROR_NOT_AVAILABLE if not available.
368 readonly attribute AString processStartupShortcut
;
371 * Returns a value corresponding to one of the
372 * |mozilla::LauncherRegistryInfo::EnabledState| values.
374 readonly attribute uint32_t launcherProcessState
;
377 * Returns the last application version that used the current profile or null
378 * if the last version could not be found (compatibility.ini was either
379 * missing or invalid). Throws NS_ERROR_UNAVAILABLE if called from a content
382 readonly attribute ACString lastAppVersion
;
385 * Returns the last application build ID that used the current profile or null
386 * if the last build ID could not be found (compatibility.ini was either
387 * missing or invalid). Throws NS_ERROR_UNAVAILABLE if called from a content
390 readonly attribute ACString lastAppBuildID
;
398 nsIXULRuntime
::ContentWin32kLockdownState GetWin32kLockdownState
();