resize window with user script

985 Views Asked by At

How do you resize current Chrome or Firefox window from Tampermonkey/Greasemonkey script. I tried

window.resizeTo(1000, 500);

, but it doesn't work for some reason. Any ideas?

1

There are 1 best solutions below

1
On BEST ANSWER

See this demo on w3schools site

Notes:

  • You can't resize a window or tab that wasn’t created by window.open.

  • You can't resize a window or tab when it’s in a window with more than one tab.