Before: 800×600
After: 850×630
// numbers depend on your window / whether resize was allowed
How It Works
Snapshot first. Read viewport size before the call.
Resize. Apply a small relative change.
Snapshot again. Compare — if equal, the browser blocked it.
Async note. MDN: resize may not be synchronous; resize event can help.
Compatibility
Browser Support
Window.resizeBy() is marked Baseline Widely available on MDN (since July 2015). Browser Window API — not a Node.js built-in. Actual resizing still depends on popup / OS policy.
✓ Baseline · Widely available
resizeBy()
Relative window resizes across modern browsers (with UX restrictions).
99%Core tag support
ChromeYes
Full support
EdgeYes
Full support
FirefoxYes
Full support*
SafariYes
Full support
OperaYes
Full support
HTML element100% supported
Bottom line: API is universal; prefer resizable script-opened popups. Do not build layout on resizeBy().
Frequently Asked Questions
It changes the current window size by a relative amount. The first argument grows or shrinks width; the second grows or shrinks height. Positive values enlarge; negative values shrink.
resizeBy(dx, dy) adjusts from the current size. resizeTo(width, height) sets an absolute outer size.
No. Browsers often block resizing tabs the user opened directly, or windows with multiple tabs. It works more reliably on popups created with window.open() and the resizable feature.
No. It returns undefined. Read innerWidth / innerHeight, or listen for the resize event, if you need to confirm a change.
Open it with the resizable feature (for example features: "resizable"). Also keep same-origin access to the popup reference.
No. MDN marks Window.resizeBy() as Baseline Widely available (since July 2015). It is not Deprecated, Experimental, or Non-standard — but browser and OS restrictions still apply.