简体   繁体   English

使用带有Firefox附加组件的javascript切换全屏模式

[英]toggling fullscreen mode with javascript with firefox add-on

The firefox add-on I am working on is best viewed in fullscreen mode. 我正在使用的firefox附加组件最好在全屏模式下查看。 (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? (我不是在创建新窗口,而是在当前页面的主体上插入一个透明的div并显示一些图片。)有没有办法用JavaScript切换全屏模式或f11键?

Thanks in advance, 提前致谢,

According to https://developer.mozilla.org/en/DOM/window.fullScreen , you should be able to just do window.fullScreen = true; 根据https://developer.mozilla.org/en/DOM/window.fullScreen ,您应该能够只执行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. 它仅在Gecko 1.9(Firefox 3)和更高版本中可靠,请参阅下面的注释。 With chrome privileges, the property is read-write. 具有chrome特权,该属性为可读写。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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