Search code examples
javascriptgreasemonkeytampermonkey

resize window with user script


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?


Solution

  • 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.