зеркало из https://github.com/mozilla/pjs.git
Bug 435772 - Carefully avoid touching Java when figuring out our execution environment, to prevent the plugin from unnecessarily starting. ChatZilla only. r=gijs
This commit is contained in:
Родитель
86256d2de6
Коммит
8e0e7b5acd
|
@ -110,17 +110,25 @@ if (DEBUG) {
|
|||
}
|
||||
|
||||
var jsenv = new Object();
|
||||
// Netscape/Mozilla security manager, for gaining priviledges with consent.
|
||||
jsenv.HAS_SECURITYMANAGER = ((typeof netscape == "object") &&
|
||||
(typeof netscape.security == "object"));
|
||||
// XPCOM, one of two socket implementation providers.
|
||||
jsenv.HAS_XPCOM = ((typeof Components == "object") &&
|
||||
(typeof Components.classes == "object"));
|
||||
jsenv.HAS_JAVA = (typeof java == "object");
|
||||
jsenv.HAS_RHINO = (typeof defineClass == "function");
|
||||
jsenv.HAS_DOCUMENT = (typeof document == "object");
|
||||
jsenv.HAS_NSPR_EVENTQ = jsenv.HAS_DOCUMENT;
|
||||
jsenv.HAS_STREAM_PROVIDER = ("nsIStreamProvider" in Components.interfaces);
|
||||
jsenv.HAS_SERVER_SOCKETS = ("nsIServerSocket" in Components.interfaces);
|
||||
jsenv.HAS_THREAD_MANAGER = ("nsIThreadManager" in Components.interfaces);
|
||||
(typeof Components.classes == "object") &&
|
||||
(typeof Components.interfaces == "object"));
|
||||
// Rhino (JS-in-Java), the other socket implementation provider.
|
||||
// XXX Bug 435772 - we avoid any Java tests if we have XPCOM so as to avoid
|
||||
// the Java plugin instanciating itself to answer our query.
|
||||
jsenv.HAS_RHINO = !jsenv.HAS_XPCOM && (typeof defineClass == "function");
|
||||
// NSPR Event Queue, i.e. we're living in a browser/GUI-like place.
|
||||
jsenv.HAS_NSPR_EVENTQ = (typeof document == "object");
|
||||
// Specific XPCOM interfaces that we really care about.
|
||||
var ci = jsenv.HAS_XPCOM ? Components.interfaces : {};
|
||||
jsenv.HAS_STREAM_PROVIDER = ("nsIStreamProvider" in ci);
|
||||
jsenv.HAS_SERVER_SOCKETS = ("nsIServerSocket" in ci);
|
||||
jsenv.HAS_THREAD_MANAGER = ("nsIThreadManager" in ci);
|
||||
delete ci;
|
||||
|
||||
function dumpObject (o, pfx, sep)
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче