Mobile app version of vmapp.org
Login or Join
Miguel251

: How do you set the width of the browser using Google Chrome In IE you can set the browser width to be 1024x768, for example, to test your site. How can you do this in Chrome? I can't find

@Miguel251

Posted in: #GoogleChrome #Testing

In IE you can set the browser width to be 1024x768, for example, to test your site. How can you do this in Chrome? I can't find an equivalent setting anywhere? I'm using 'Tools -> Developer tools'.

I can't do the fallback trick of running

javascript:window.resizeTo(1024,768)


in the location bar, because Chrome tries to search for it!

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Miguel251

1 Comments

Sorted by latest first Latest Oldest Best

 

@XinRu657

You must type (not copy-paste) the entire Javascript (including "javascript:") into the address bar to execute Javascript - Chrome will strip the "javascript:" protocol specification and treat your Javascript as a search if your last action in the address bar is copy-pasting.

A more convenient way to execute arbitrary Javascript in Chrome would be to open the Javascript Console (Ctrl+Shift+J), however, the resizeTo() function is not supported for tabs so you'll need to enter something creative in the console to make this work:

var myTestWindow = window.open(window.location); myTestWindow.resizeTo(1024,768);


(subsequent changes to the pop-up window's size can be made by calling myTestWindow.resizeTo(x,y))

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme