1

I am trying to open a popup at the screen's full width and height using the code below:

var params = 'width=' + screen.width + ', height=' + screen.height
            + ', top=0, left=0'
            + ',toolbar=no,scrollbars=no,status=no,menubar=no';

screenServiceFactory.windows[id] = window.open(location, id, params);

screen.height and screen.width accurately get my screen resolution, and the window opens up at position 0,0 ... but it's actually too large! There are a hundred or so in extra height and a few in extra width that bleed off the monitor. I've tried a bunch of different ways of detecting screen resolution and window sizing and read every stack overflow post on the topic but have been unable to produce a better result. What am I doing wrong?

I am noticing it doesn't account for reserved screen space such as osx side menu, windows start menu, etc... I want the window to have the same size as if a user maximized it.

  1. How can I open the window at full width and height for the monitor, with a similar feel to if the user clicked Maximize on the window
Joshua Ohana
  • 5,613
  • 12
  • 56
  • 112

2 Answers2

1

Add 'fullscreen=yes' into params.

Here is the reference in http://www.w3schools.com/jsref/met_win_open.asp

fullscreen=yes|no|1|0 Whether or not to display the browser in full-screen mode. Default is no. A window in full-screen mode must also be in theater mode. IE only

Lumi Lu
  • 3,289
  • 1
  • 11
  • 21
  • 1
    Thanks but I do not want fullscreen mode, I want it windowed but "maximized", eg: width = screen width and height = available screen height – Joshua Ohana Feb 19 '15 at 19:06
0

window.open has a fullscreen spec. Tried this? Info: http://www.w3schools.com/jsref/met_win_open.asp

com2ghz
  • 2,706
  • 3
  • 16
  • 27
  • I see this is IE only and firefox seems to support it too. Chrome doesn't support this. Use screen.height and screen.width: http://stackoverflow.com/questions/13192313/child-window-full-size-in-chrome – com2ghz Feb 19 '15 at 15:57
  • Thanks but I do not want fullscreen mode, I want it windowed but "maximized", eg: width = screen width and height = available screen height. As for using screen.height/width, that's what I'm doing now but it seems to keep making the window too large and it's actually larger than the monitor's display – Joshua Ohana Feb 19 '15 at 19:07