diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp index 02910c82807..95180f488ce 100644 --- a/toolkit/xre/nsAppRunner.cpp +++ b/toolkit/xre/nsAppRunner.cpp @@ -3304,14 +3304,17 @@ XREMain::XRE_mainInit(bool* aExitFlag) // order bit will be 1 if the key is pressed. By masking the returned short // with 0x8000 the result will be 0 if the key is not pressed and non-zero // otherwise. - if (GetKeyState(VK_SHIFT) & 0x8000 && - !(GetKeyState(VK_CONTROL) & 0x8000) && !(GetKeyState(VK_MENU) & 0x8000)) { + if ((GetKeyState(VK_SHIFT) & 0x8000) && + !(GetKeyState(VK_CONTROL) & 0x8000) && + !(GetKeyState(VK_MENU) & 0x8000) && + !EnvHasValue("MOZ_DISABLE_SAFE_MODE_KEY")) { gSafeMode = true; } #endif #ifdef XP_MACOSX - if (GetCurrentEventKeyModifiers() & optionKey) + if ((GetCurrentEventKeyModifiers() & optionKey) && + !EnvHasValue("MOZ_DISABLE_SAFE_MODE_KEY")) gSafeMode = true; #endif