亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

javascript - js Make Google Chrome maximize instead of full screen (F11)
給我你的懷抱
給我你的懷抱 2017-05-19 10:37:01
0
2
1084

js Maximize Google Chrome instead of full screen (F11)

給我你的懷抱
給我你的懷抱

reply all(2)
黃舟

Theoretically, js supports

window.resizeTo( screen.availWidth, screen.availHeight );

But in fact, each browser has different restrictions on this kind of behavior. Just imagine that you open a page and the page is directly made into full screen. That is very sad.
Similarly restricted, there are also windows .open, continuous pop-up alerts, etc.
This is the page permission.

There are also browser permissions. If you are developing a chrome extension, you should not be restricted

Additional point: Different similar trigger situations may have different results. Self-execution will have more restrictions, such as
document.body.onload = function() {
video.play()
};
Playing a video directly as soon as you enter the page is very frustrating. Some browsers restrict this type of behavior and can only use triggering:
document.body.onclick = function() {

video.play(); // 這就不受影響

};

淡淡煙草味
function launchFullscreen(element) {
  if(element.requestFullscreen) {
    element.requestFullscreen();
  } else if(element.mozRequestFullScreen) {
    element.mozRequestFullScreen();
  } else if(element.msRequestFullscreen){
    element.msRequestFullscreen();
  } else if(element.webkitRequestFullscreen) {
    element.webkitRequestFullScreen();
  }
}

launchFullscreen(document.documentElement);

You can refer here to learn more: http://javascript.ruanyifeng....

However, for operations such as changing the browser size, position, and full screen, the browser believes that this should be decided by the user rather than the website developer, so this type of code is blocked by default.
A similar prompt will appear:

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template