开发者

Determining if Chrome is in Fullscreen Mode for extension development

Unsatisfied with the current extensions and workarounds to enter in a URL while full-screened in Google Chrome, I'm trying to write my own. Is there some kind 开发者_运维技巧of Event or Attribute I can check/use with the Chrome API to find out if the browser is in full-screen mode?


Well, there are some extensions out there that does Fullscreen controls.

Right now, if you want to check if Chrome is in fullscreen, you can use simple JavaScript functionality to do this:

var is_fullscreen = (screen.width == window.outerWidth &&
                     screen.height == window.outerHeight);

Note, the above must be used in a content script.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜