mirror of
https://github.com/bitwarden/browser
synced 2025-12-11 22:03:36 +00:00
[PM-15410][PM-15410] add nullish check when referencing document in BrowserPopupUtils (#12162)
* check if document is undefined before accessing `body`
This commit is contained in:
@@ -109,7 +109,10 @@ class BrowserPopupUtils {
|
|||||||
const defaultPopoutWindowOptions: chrome.windows.CreateData = {
|
const defaultPopoutWindowOptions: chrome.windows.CreateData = {
|
||||||
type: "popup",
|
type: "popup",
|
||||||
focused: true,
|
focused: true,
|
||||||
width: Math.max(PopupWidthOptions.default, document.body.clientWidth),
|
width: Math.max(
|
||||||
|
PopupWidthOptions.default,
|
||||||
|
typeof document === "undefined" ? PopupWidthOptions.default : document.body.clientWidth,
|
||||||
|
),
|
||||||
height: 630,
|
height: 630,
|
||||||
};
|
};
|
||||||
const offsetRight = 15;
|
const offsetRight = 15;
|
||||||
|
|||||||
Reference in New Issue
Block a user