简体   繁体   中英

toggling fullscreen mode with javascript with firefox add-on

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,

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM