css - Can javascript prevent Safari from swiping right from the left edge to return? Is there any other way?
滿天的星座
滿天的星座 2017-05-16 13:36:16
0
4
802

There is no Android back button on iOS, so you can go back by swiping right on the left edge. But now I want to disable this function in Safari, is it possible? That means the user can only go down step by step and cannot go back. After searching on Baidu, I found that they are all native iOS solutions. So can the web front-end use JavaScript to implement this function?

滿天的星座
滿天的星座

reply all(4)
小葫芦

Unable to achieve.

阿神

After searching Google, there is no solution. You can consider using a single-page application to avoid this problem

滿天的星座

Based on my understanding, I propose two methods, I don’t know if they will be useful to you
1. Each time the page is loaded, replace the referrer with the current URL or a fixed homepage URL, so that clicking return will stay on the current page or return directly to the homepage;
2. If the page is not too complicated, it can be made into one page, so that no matter how many next steps there are, they are all on the same page, and clicking return will return to the first page;
If you find a more effective way to reply I’ll be fine soon

習慣沉默

You can try history to operate the browser’s history

Change the current page to the next page you want, so you won’t be able to return to the previous page.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!