1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 19:26:13 +02:00

fixes firefox popup location (#8467)

Co-Authored-By: Whymarrh Whitby <whymarrh.whitby@gmail.com>
This commit is contained in:
Brad Decker 2020-04-29 17:04:03 -05:00 committed by GitHub
parent ee5e84af61
commit 0c7269f599
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 0 deletions

View File

@ -54,6 +54,11 @@ class NotificationManager {
left, left,
top, 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 this._popupId = popupWindow.id
} }
} }

View File

@ -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 () { getLastFocusedWindow () {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
extension.windows.getLastFocused((windowObject) => { extension.windows.getLastFocused((windowObject) => {