I want to ask if there's method dynamically set the position or move the Browser Window to the bottom right?
BrowserWindow.setPosition(x, y)
To make an Electron app run in full-screen mode when it's started, pass the following configuration option when creating the BrowserWindow instance: mainWindow = new BrowserWindow({fullscreen: true});
getElementById("close-btn"). addEventListener("click", function (e) { var window = remote. getCurrentWindow(); window. close(); });
Here are two keyboard shortcuts to move window: 1 Win + Left Arrow: snap the window to the left 2 Win + Right Arrow: snap the window to the right More ...
Step 1: Click the window or you can use the keyboard shortcut – Alt + Tab and let the window that you want to move active. Step 3: Press M (equal to selecting the Move option) and the mouse cursor will turn into a cross with arrows and move to the title bar of the window.
Select Move from the pop-up menu. Press the left arrow or right arrow key until the program or app appears on the screen. A similar method swaps out the Shift key for the Windows key. It also relies on the snapping feature that snaps windows to the sides of your screen.
Some involve using different keys on the keyboard, while others involved adjusting settings within Windows 10. This method uses the left and right arrow keys on your keyboard to move off-screen windows. Launch the program or app (if it’s not opened already). Press the Shift key and right-click the active program or app icon located on the taskbar .
You can use the screen API, and use a fixed with to offset from the edge of the screen:
let display = electron.screen.getPrimaryDisplay();
let width = display.bounds.width;
win = new BrowserWindow({
width: 600,
x: width - 600,
y: 0
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With