简体   繁体   中英

Open webpage in fullscreen in Safari on iOS

There is a fullscreen mode in Safari on iOS. Is it possible to activate this through javascript or similar?

Thanks

No, there is no way to toggle the fullscreen mode in Safari on iOS using javascript.

In order for a web page to run in fullscreen mode, you need to add the following meta tag, and the page needs to be started from a bookmark on the home screen:

<meta name="apple-mobile-web-app-capable" content="yes">

However, you can detect if the page is running in fullscreen mode or not with javascript using the read only property:

window.navigator.standalone

Aftier iOS >= 12, There is only way to toggle to fullscreen through native API in Safari.

    if (document.webkitFullscreenElement) {
      document.webkitCancelFullScreen();
    } else {
      const el = document.documentElement;
      el.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
    }

It seems to be possible now, to see webpages in full screen. In iPad, I pushed/scrolled the webpage up, even after reaching the top of webpage; which then pushed the search bar up, and allowed seeing webpage in full screen in Safari and Firefox.

On clicking the text or header of the page, webpage came out of full screen again.

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