views:

211

answers:

1

The firefox add-on I am working on is best viewed in fullscreen mode. (I am not creating a new window, but I insert a transparent div on the body of the current page and display some pictures.) Is there a way to toggle the fullscreen mode or f11 key with javascript?

Thanks in advance,

+1  A: 

According to https://developer.mozilla.org/en/DOM/window.fullScreen, you should be able to just do window.fullScreen = true; (provided that your script is running in the browser window, not some other window, in which case you may have to jump through a couple hoops to get a reference to the main browser window)

This property indicates whether the window is displayed in full screen mode or not. It is only reliable in Gecko 1.9 (Firefox 3) and later, see the Notes below. With chrome privileges, the property is read-write.

MatrixFrog
yes that works... I did not realize that window.fullScreen was writable. Thanks.
artsince