隐藏在Chrome移动浏览器的地址栏(机器人)机器人、地址栏、浏览器、Chrome

2023-09-13 01:34:45 作者:西毒残阳

我们有一个网站,在那里有一个简单的JavaScript

We have a site, where with a simple JavaScript

<body onLoad="setTimeout(function() {window.scrollTo(0, 1)}, 100);">

我们隐藏在大多数浏览器(Safari和Android原生浏览器)的地址栏这一行JavaScript的罚款最多的,但我们已经注意到了镀铬一个奇怪的现象,在网页确实向下滚动,但地址栏没有按躲起来!页面加载后,如果用户向下滚动用手指一点点,地址栏通常隐藏。

We hide the address bar on most browsers (safari, and the native android browser) this line of JavaScript works fine for most, but we have noticed a strange behavior on chrome, the page indeed scroll down, but the address bar doesn't hide! After the loading of the page, if the user scrolls down a little bit with the finger, the address bar hides normally.

我也试图向下滚动所有页面的JS,以饱满的滚动页面的结果,而地址栏仍是可见的...

I have also tried to scroll down all the page with the JS, with the result of the page full scrolled, and the address bar is still visible...

任何人都知道,如果有一些诀窍,我忘了用,如果此功能根本就不是present在Chrome浏览器?

Anyone knows if there is some trick I forgot to use, or if this function is simply not present in Chrome?

推荐答案

scrollTo(0,1)目前还不支持在Chrome浏览器Android版(这是最近加入,然后删除)。我们确实有全屏API,但是这是一个有点沉重递给你想达到什么。

scrollTo(0,1) is not yet supported in Chrome for Android (it was recently added and then removed). We do have the FullScreen API but that is a little heavy handed for what you want to achieve.

 
精彩推荐