I'm pretty sure that browser vendors have disabled the window.resizeTo()
command because folks in the 90s abused it quite a lot. You might be able to use it to still change a popup window you created yourself in code, but most popup windows are disabled for similar reasons .
About the best you can do is enter/exit fullscreen for changing the browser size.