Skip to content

Commit d3fc80e

Browse files
committed
Add default values if no windows are returned
1 parent 688bed6 commit d3fc80e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/environment/background/permissions.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ async function makePromptWindow({ permissions, origins }) {
2626
const height = 255;
2727

2828
// Get the current window's dimensions and calculate center position
29-
const { width: screenWidth, height: screenHeight } = await chrome.windows.getCurrent();
29+
const { width: screenWidth, height: screenHeight } = await chrome.windows.getCurrent() || { width: 1920, height: 1080 };
3030
const left = Math.floor(screenWidth / 2 - width / 2);
3131
const top = Math.floor(screenHeight / 2 - height / 2);
3232

0 commit comments

Comments
 (0)