mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 18:00:18 +01:00
fixes firefox popup location (#8467)
Co-Authored-By: Whymarrh Whitby <whymarrh.whitby@gmail.com>
This commit is contained in:
parent
ee5e84af61
commit
0c7269f599
@ -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
|
||||
}
|
||||
}
|
||||
|
@ -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) => {
|
||||
|
Loading…
Reference in New Issue
Block a user