How to do window.open with no scrollbars in Google Chrome How to do window.open with no scrollbars in Google Chrome google-chrome google-chrome

How to do window.open with no scrollbars in Google Chrome


This style should do the trick, add it to the opened window document:

body{ overflow-x:hidden;overflow-y:hidden; }


You shouldn't remove scrollbars. If I have my font setting insanely large and didn't know of other ways to scroll other than scrollbars, I won't be able to actually view the content of the popup. Same goes for overflow: hidden. Just don't do it, as there is no way to make sure the content of the page will fit in an exact size. Scrollbars don't appear by default if the page isn't overflowing, so your problem is most likely that your popup is too small for the page you're loading in it. Also, most people hate popups, so you may want to try a less-intrusive approach, such as small yet exuberantly colored box to grab the user's attention.


Google Chrome goes the extra mile for users by automatically capturing many popups and suppressing them into a notification area in the bottom-right corner of the browser, giving the user the option to manually launch them or not. Additionally Google pushes updates to browsers regularly and if your popup isn't captured by Chrome now it might be in the future.

Also many tools on systems nowadays prevent or block popups so the odds are against your popup on many levels.

Recommendation

It's recommended to mock a popup window using the page DOM (e.g. using a DIV styled to look like a popup window). Many sites are moving this way to get past popup blockers.

There are many examples on the Internet. For example using JavaScript to create a Popup, using jQuery API to create a popup jQuery is a JavaScript layer on top of JavaScript and will give you some implicit cross-browser compatibility features.

You will be able to have scrolling inside the mocked popup using CSS

div {width:150px;height:150px;overflow:scroll;/* etc... */}

or to suppress it overflow:hidden;