views:

6073

answers:

10

I want to run a psychological study for which participants have to look at large images.

The experiment is done on the web and therefore in a browser window. Is it possible to tell the browser to go into fullscreen, for example on button press?

I know there is the possibility to open a fixed-size popup window. Do you think this would be a feasable alternative? And if, what would be the best way to do it? Are there elegant ways of detecting a popup-blocker, to fallback and run the study in the original browser window.

The main concern is that the participants of this study are not familiar with technical details and should not be bothered by them.

A: 

F11 takes IE and Firefox into fullscreen mode. I'm sure it's possible to go fullscreen, since YouTube and other video streaming sites can do it with Flash, but I don't know how with javascript.

Scottie T
+1  A: 

In the past, I've seen websites do this. However, as it's incredibly annoying and generally used by ads for pr0n websites, the technique may be blocked in recent browsers.

But I think the important point is: it's incredibly annoying and generally used by ads for pr0n websites, so you probably don't want to associate yourself which such things, so your probably best off just asking your users to maximize their browsers.

James Curran
For an internal process such as this, I think it makes sense.
Darryl Hein
I use it only for a study where participants are invited for and they will get instructions beforehand.
ypnos
As long as it's specifically mentioned in the instructions: altering the size of the window (or anything else the user's specifically set) without the user's consent is generally not good practice.
Dave DuPlantis
+3  A: 

There isn't a way to resize the current window to full screen, but you can open a popup in full screen:

<script type="text/javascript">
<!--
function popup(url) 
{
 params  = 'width='+screen.width;
 params += ', height='+screen.height;
 params += ', top=0, left=0'
 params += ', fullscreen=yes';

 newwin=window.open(url,'windowname4', params);
 if (window.focus) {newwin.focus()}
 return false;
}
// -->
</script>

<a href="javascript: void(0)" 
   onclick="popup('popup.html')">Fullscreen popup window</a>
Darryl Hein
Thank you, is there also an easy possibility to alter the original page on successful load of the popup? So that the user doesn't start the study twice in the end..
ypnos
See response as another answer.
Darryl Hein
A: 

Youtube uses flash. I hope it's not possible to do it with html/js...

horatio
+5  A: 

You could just tell the user to press F11. Next to it, put a 'why?' link and explain why you feel like they need to be in fullscreen mode.

I don't think you can force a browser to go full screen and, in fact, if you were able to do that I'd be furious at my browser. It's too invasive. Even Flash has security so that forcing the plugin to go to fullscreen requires the event to originate with a user interaction. So, if it's that important to you, this might be a good reason to use the Flash plugin because you could attach the go-fullscreen call to a misleading button that says 'start quiz' (or whatever).

But, please don't do that. Just be straight forward with the user and tell them to hit F11.

EDIT: I just tried the sample code provided in another comment and I'm happy to say that Firefox opens up a maximized window with an address bar, not a fullscreen window.

mqsoh
Don't worry, I want to give an optional "set me fullscreen" button. Good to know that F11 works for most browsers.
ypnos
F11 does nothing for Chrome, just FYI...
matt lohkamp
@matt this is no longer true. Chrome 3 goes to fullscreen on F11.
itsadok
+3  A: 

Open a new window in full screen mode on IE:

<script>
<!--
window.open("page.html","fs","fullscreen,scrollbars")
//-->
</script>

Putting in a "Close" link on page.html may be a good idea:

<a href="#" onclick="window.close()">Close Window</a>
micahwittman
+1  A: 

To modify the parent window, try something like:

window.opener.location.href = '/confirmation/page.html';
Darryl Hein
A: 

Is this really a psychology study, or are you trying to goatse random people with a full screen image?

wnoise
A: 

"...or are you trying to goatse random people with a full screen image?"

this defines psychological study ;/

me_me_me
A: 

it would be very useful for web apps.

tof38