From 47b8c58d47bae45d723ef22665e8f13ecc66725f Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Sun, 18 Feb 2018 13:12:13 +0100 Subject: Prevent installing stand-alone installers on unsupported environments. - Prevent installers from installing on XP/Vista. - Prevent x64 installers from installing on x86. --- .../bootstrapinstaller/maintenanceservice_installer.nsi | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'toolkit/components') diff --git a/toolkit/components/maintenanceservice/bootstrapinstaller/maintenanceservice_installer.nsi b/toolkit/components/maintenanceservice/bootstrapinstaller/maintenanceservice_installer.nsi index 9e831dc9c..d4d21e377 100644 --- a/toolkit/components/maintenanceservice/bootstrapinstaller/maintenanceservice_installer.nsi +++ b/toolkit/components/maintenanceservice/bootstrapinstaller/maintenanceservice_installer.nsi @@ -117,10 +117,7 @@ Function .onInit System::Call 'kernel32::SetDllDirectoryW(w "")' SetSilent silent - ; On Windows 2000 we do not install the maintenance service. - ; We won't run this installer from the parent installer, but just in case - ; someone tries to execute it on Windows 2000... - ${Unless} ${AtLeastWinXP} + ${Unless} ${AtLeastWin7} Abort ${EndUnless} FunctionEnd -- cgit v1.2.3 From b55f0e7f0d3c66b609ac8979265c62bd1fa85bb6 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Sun, 18 Feb 2018 13:27:04 +0100 Subject: Update executable manifests. --- toolkit/components/maintenanceservice/maintenanceservice.exe.manifest | 1 - 1 file changed, 1 deletion(-) (limited to 'toolkit/components') diff --git a/toolkit/components/maintenanceservice/maintenanceservice.exe.manifest b/toolkit/components/maintenanceservice/maintenanceservice.exe.manifest index cb317c47d..e6bfba8ca 100644 --- a/toolkit/components/maintenanceservice/maintenanceservice.exe.manifest +++ b/toolkit/components/maintenanceservice/maintenanceservice.exe.manifest @@ -20,7 +20,6 @@ - -- cgit v1.2.3 From c7668971968e044e85446d79362d7744846efdd0 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Mon, 19 Feb 2018 10:00:25 +0100 Subject: Remove the use of GetProcAddress() for shell32 This avoids manually hooking into shell32.dll and using the native shell API instead. Tag #22. --- toolkit/components/alerts/nsAlertsService.cpp | 23 ++++++++--------------- toolkit/components/alerts/nsAlertsService.h | 17 ----------------- 2 files changed, 8 insertions(+), 32 deletions(-) (limited to 'toolkit/components') diff --git a/toolkit/components/alerts/nsAlertsService.cpp b/toolkit/components/alerts/nsAlertsService.cpp index 35418dd17..dd67ad983 100644 --- a/toolkit/components/alerts/nsAlertsService.cpp +++ b/toolkit/components/alerts/nsAlertsService.cpp @@ -22,6 +22,10 @@ #include "nsIFaviconService.h" #endif // MOZ_PLACES +#ifdef XP_WIN +#include +#endif + using namespace mozilla; using mozilla::dom::ContentChild; @@ -154,23 +158,12 @@ bool nsAlertsService::ShouldShowAlert() bool result = true; #ifdef XP_WIN - HMODULE shellDLL = ::LoadLibraryW(L"shell32.dll"); - if (!shellDLL) - return result; - - SHQueryUserNotificationStatePtr pSHQueryUserNotificationState = - (SHQueryUserNotificationStatePtr) ::GetProcAddress(shellDLL, "SHQueryUserNotificationState"); - - if (pSHQueryUserNotificationState) { - MOZ_QUERY_USER_NOTIFICATION_STATE qstate; - if (SUCCEEDED(pSHQueryUserNotificationState(&qstate))) { - if (qstate != QUNS_ACCEPTS_NOTIFICATIONS) { - result = false; - } + QUERY_USER_NOTIFICATION_STATE qstate; + if (SUCCEEDED(SHQueryUserNotificationState(&qstate))) { + if (qstate != QUNS_ACCEPTS_NOTIFICATIONS) { + result = false; } } - - ::FreeLibrary(shellDLL); #endif return result; diff --git a/toolkit/components/alerts/nsAlertsService.h b/toolkit/components/alerts/nsAlertsService.h index 3f23eaabf..d2b2e1e6c 100644 --- a/toolkit/components/alerts/nsAlertsService.h +++ b/toolkit/components/alerts/nsAlertsService.h @@ -10,23 +10,6 @@ #include "nsCOMPtr.h" #include "nsXULAlerts.h" -#ifdef XP_WIN -typedef enum tagMOZ_QUERY_USER_NOTIFICATION_STATE { - QUNS_NOT_PRESENT = 1, - QUNS_BUSY = 2, - QUNS_RUNNING_D3D_FULL_SCREEN = 3, - QUNS_PRESENTATION_MODE = 4, - QUNS_ACCEPTS_NOTIFICATIONS = 5, - QUNS_QUIET_TIME = 6, - QUNS_IMMERSIVE = 7 -} MOZ_QUERY_USER_NOTIFICATION_STATE; - -extern "C" { -// This function is Windows Vista or later -typedef HRESULT (__stdcall *SHQueryUserNotificationStatePtr)(MOZ_QUERY_USER_NOTIFICATION_STATE *pquns); -} -#endif // defined(XP_WIN) - class nsAlertsService : public nsIAlertsService, public nsIAlertsDoNotDisturb { -- cgit v1.2.3 From d8598c1ed3264de0e7b6de21f62d4d5125177677 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Thu, 10 Aug 2017 17:39:03 +0200 Subject: Notifications - Run (Desktop) Notifications twice (and more) in a row does not work --- .../components/alerts/resources/content/alert.js | 28 ++++++++++++++++++++-- .../components/alerts/resources/content/alert.xul | 1 + 2 files changed, 27 insertions(+), 2 deletions(-) (limited to 'toolkit/components') diff --git a/toolkit/components/alerts/resources/content/alert.js b/toolkit/components/alerts/resources/content/alert.js index 523ec378e..ead4d503f 100644 --- a/toolkit/components/alerts/resources/content/alert.js +++ b/toolkit/components/alerts/resources/content/alert.js @@ -7,7 +7,21 @@ var {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components; Cu.import("resource://gre/modules/AppConstants.jsm"); Cu.import("resource://gre/modules/Services.jsm"); -// Copied from nsILookAndFeel.h, see comments on eMetric_AlertNotificationOrigin +/* + * This indicates from which corner of the screen alerts slide in, + * and from which direction (horizontal/vertical). + * 0, the default, represents bottom right, sliding vertically. + * Use any bitwise combination of the following constants: + * NS_ALERT_HORIZONTAL (1), NS_ALERT_LEFT (2), NS_ALERT_TOP (4). + * + * 6 4 + * +-----------+ + * 7| |5 + * | | + * 3| |1 + * +-----------+ + * 2 0 + */ const NS_ALERT_HORIZONTAL = 1; const NS_ALERT_LEFT = 2; const NS_ALERT_TOP = 4; @@ -41,6 +55,8 @@ function prefillAlertInfo() { // arguments[11] -> the nsIURI.hostPort of the origin, optional // arguments[12] -> the alert icon URL, optional + document.getElementById('alertTime').setAttribute('value', (new Date).getTime()); + switch (window.arguments.length) { default: case 13: { @@ -235,7 +251,15 @@ function moveWindowToEnd() { let windows = Services.wm.getEnumerator("alert:alert"); while (windows.hasMoreElements()) { let alertWindow = windows.getNext(); - if (alertWindow != window) { + let alertWindowTime = Number( + alertWindow.document.getElementById('alertTime').getAttribute('value')); + let windowTime = Number( + window.document.getElementById('alertTime').getAttribute('value')); + // The time of window creation. + // Otherwise calling the notification twice (and more) in a row + // does not work. + // See https://bugzilla.mozilla.org/show_bug.cgi?id=1263155 + if ((alertWindow != window) && (alertWindowTime <= windowTime)) { if (gOrigin & NS_ALERT_TOP) { y = Math.max(y, alertWindow.screenY + alertWindow.outerHeight - WINDOW_SHADOW_SPREAD); } else { diff --git a/toolkit/components/alerts/resources/content/alert.xul b/toolkit/components/alerts/resources/content/alert.xul index 8597d9954..1549f4530 100644 --- a/toolkit/components/alerts/resources/content/alert.xul +++ b/toolkit/components/alerts/resources/content/alert.xul @@ -24,6 +24,7 @@