在iOS上的Safari中全屏打开网页 [英] Open webpage in fullscreen in Safari on iOS

查看:1159
本文介绍了在iOS上的Safari中全屏打开网页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

iOS上的Safari中有全屏模式。是否可以通过javascript或类似方式激活它?

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

谢谢

推荐答案

不,无法使用javascript在iOS上的Safari中切换全屏模式。

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">

但是,可以检测页面是以全屏模式运行还是不使用javascript使用只读属性:

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

window.navigator.standalone

这篇关于在iOS上的Safari中全屏打开网页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆