From 0c7269f599d9330213a5e8d6222bd1593bd74322 Mon Sep 17 00:00:00 2001 From: Brad Decker Date: Wed, 29 Apr 2020 17:04:03 -0500 Subject: [PATCH] fixes firefox popup location (#8467) Co-Authored-By: Whymarrh Whitby --- app/scripts/lib/notification-manager.js | 5 +++++ app/scripts/platforms/extension.js | 12 ++++++++++++ 2 files changed, 17 insertions(+) diff --git a/app/scripts/lib/notification-manager.js b/app/scripts/lib/notification-manager.js index 218dd290e..e3516f5d8 100644 --- a/app/scripts/lib/notification-manager.js +++ b/app/scripts/lib/notification-manager.js @@ -54,6 +54,11 @@ class NotificationManager { left, top, }) + + // Firefox currently ignores left/top for create, but it works for update + if (popupWindow.left !== left) { + await this.platform.updateWindowPosition(popupWindow.id, left, top) + } this._popupId = popupWindow.id } } diff --git a/app/scripts/platforms/extension.js b/app/scripts/platforms/extension.js index 831b158c9..87bbb93ce 100644 --- a/app/scripts/platforms/extension.js +++ b/app/scripts/platforms/extension.js @@ -60,6 +60,18 @@ class ExtensionPlatform { }) } + updateWindowPosition (windowId, left, top) { + return new Promise((resolve, reject) => { + extension.windows.update(windowId, { left, top }, () => { + const error = checkForError() + if (error) { + return reject(error) + } + return resolve() + }) + }) + } + getLastFocusedWindow () { return new Promise((resolve, reject) => { extension.windows.getLastFocused((windowObject) => {