nsIXULRuntime 编辑
xpcom/system/nsIXULRuntime.idl
Scriptable Provides information about the XUL runtime to allow extensions and XUL applications to determine information about the XUL runtime. 1.0 66 Introduced Gecko 1.8 Inherits from: nsISupports
Last changed in Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)Implemented by: @mozilla.org/xre/app-info;1
. To get an instance, use:
var xulRuntime = Components.classes["@mozilla.org/xre/app-info;1"] .getService(Components.interfaces.nsIXULRuntime);
Method overview
void invalidateCachesOnRestart(); |
Attributes
Attribute | Type | Description |
accessibilityEnabled | boolean | If true, the accessibility service is running. Read only. |
browserTabsRemoteAutostart | boolean | If true, browser tabs may be opened by default in a different process from the main browser UI. Read only. |
inSafeMode | boolean | Whether the application was launched in safe mode. Read only. |
is64Bit | boolean | Indicates whether the current Firefox build is 64-bit. Read only. |
logConsoleErrors | boolean | Whether to write console errors to a log file. If a component encounters startup errors that might prevent the app from showing proper UI, it should set this flag to true . |
OS | AUTF8String | A string tag identifying the current operating system. This is taken from the OS_TARGET configure variable. It will always be available. Read only. |
processID | unsigned long | The system process ID of the caller's process. Read only. |
processType | unsigned long | The type of the caller's process. Returns one of process type constants. Read only. |
widgetToolkit | AUTF8String | A string tag identifying the target widget toolkit in use. This is taken from the MOZ_WIDGET_TOOLKIT configure variable. Read only. |
XPCOMABI | AUTF8String | A string tag identifying the binary ABI of the current processor and compiler vtable. This is taken from the TARGET_XPCOM_ABI configure variable. It may not be available on all platforms, especially unusual processor or compiler combinations. The result takes the form <processor>-<compilerABI>, for example: x86-msvc ppc-gcc3. This value should almost always be used in combination withOS .May throw |
Constants
Process type constants
Constant | Value | Description |
PROCESS_TYPE_DEFAULT | 0 | The default (chrome) process. |
PROCESS_TYPE_PLUGIN | 1 | A plugin subprocess. |
PROCESS_TYPE_CONTENT | 2 | A content subprocess. |
PROCESS_TYPE_IPDLUNITTEST | 3 | IPDL unit testing subprocess. |
Methods
invalidateCachesOnRestart()
Signal the apprunner to invalidate caches on the next restart. This will cause components to be auto registered and all fast load data to be re-created.
void invalidateCachesOnRestart();
Parameters
None.
Example
Display the user's operating system in an alert box:
var xulRuntime = Components.classes["@mozilla.org/xre/app-info;1"]
.getService(Components.interfaces.nsIXULRuntime);
alert(xulRuntime.OS);
See also
nsIXULAppInfo
- a related interface providing information about the host application, it's also implemented by xre/app-info.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论