// Shrink the window
window.resizeBy(-200, -200);Window: resizeBy() method / notebook
Window: resizeBy() method
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
// Create resizable window
myExternalWindow = window.open(
"https://example.com",
"myWindowName",
"resizable",
);
// Resize window to 500x500
myExternalWindow.resizeTo(500, 500);
// Make window relatively smaller to 400x400
myExternalWindow.resizeBy(-100, -100);