nsIXULRuntime 编辑

xpcom/system/nsIXULRuntime.idlScriptable 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

AttributeTypeDescription
accessibilityEnabledbooleanIf true, the accessibility service is running. Read only.
browserTabsRemoteAutostartbooleanIf true, browser tabs may be opened by default in a different process from the main browser UI. Read only.
inSafeModeboolean

Whether the application was launched in safe mode. Read only.

is64BitbooleanIndicates whether the current Firefox build is 64-bit. Read only.
logConsoleErrorsbooleanWhether 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.
OSAUTF8StringA string tag identifying the current operating system. This is taken from the OS_TARGET configure variable. It will always be available. Read only.
processIDunsigned longThe system process ID of the caller's process. Read only.
processTypeunsigned longThe type of the caller's process. Returns one of process type constants. Read only.
widgetToolkitAUTF8StringA string tag identifying the target widget toolkit in use. This is taken from the MOZ_WIDGET_TOOLKIT configure variable. Read only.
XPCOMABIAUTF8String

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 with OS.

May throw NS_ERROR_NOT_AVAILABLE.

Read only.

Constants

Process type constants

ConstantValueDescription
PROCESS_TYPE_DEFAULT0The default (chrome) process.
PROCESS_TYPE_PLUGIN1A plugin subprocess.
PROCESS_TYPE_CONTENT2A content subprocess.
PROCESS_TYPE_IPDLUNITTEST3IPDL 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:80 次

字数:6619

最后编辑:7年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文