禁止在Chrome上显示简化视图提示或使用简化视图 [英] Prevent show simplified view prompt or work with simplified view on Chrome

查看:477
本文介绍了禁止在Chrome上显示简化视图提示或使用简化视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果按照我的设计方式浏览,我的网站看起来不错.每次我从Android上的Chrome浏览器访问它时,屏幕底部都会提示我显示简化视图".如果我单击该提示以简化视图查看它,则该站点将仅显示1个新闻项(在页面上应该显示25个),它将删除所有控件(登录,添加新闻项,评论)并滚动不再工作了.还有其他多个问题(标题/图像/文章摘录不匹配,缺少配色方案等).这仅发生在Google Chrome上,我测试过的其他浏览器都没有.

在其他网站上,我看不到切换到简化视图的提示.我的首选是在我的网站上放置一个标签,以永不显示此提示.我已经在谷歌上搜索了,但是我只找到了关于如何从Chrome开启该功能的文章,而没有关于如何从服务器端禁用该功能的文章.

我的第二个想法可能是使用这种简化的视图并使它对想要使用它的人起作用.但是,我已经读到它也阻止了所有广告,并且我的网站仅受广告支持,因此,如果我绝对不能阻止该提示出现,这将是遥不可及的时间.

总结:

  1. 如何防止显示显示简化视图"提示或
  2. 失败了,如何设置我的网站以使用简化视图?

解决方案

我找到的答案是根据媒体宽度更改字体大小,并且一旦字体大小足够大以至于可以在移动设备上阅读我正在使用,它不再建议简化视图.使用的确切代码是:

@media (max-width: 540px) {
    body {
        font-size:18px !important;
    }
}

很简单.

I have a website which looks good if viewed the way I designed it. Every time I visit it from Chrome on Android, I am given a prompt along the bottom of the screen to "Show Simplified View". If I click that prompt to actually see it in simplified view, the site will only display 1 news item (there are supposed to be 25 on a page), it removes all controls (log in, add news item, comments), and scrolling doesn't work anymore. There are multiple other problems as well (headlines/images/article excerpts are not matched together, color scheme is missing, etc.) This happens only on Google Chrome, no other browser I've tested does this.

I don't see the prompt to switch to simplified view on other sites. My preference would be to place a tag on my site to never show this prompt. I have googled around for that, but I have only found articles about how to turn the feature on from Chrome, nothing about how to disable the feature from the server side.

My second thought might be to work with this simplified view and get it functional for people who want to use it. However, I have read that it also blocks all advertising and my site is supported solely by ads, so this is a distant second if I absolutely can't prevent the prompt from appearing.

TO SUM UP:

  1. How can I prevent the "Show simplified view" prompt from appearing or
  2. Failing that, how do I set up my site to work with simplified view?

解决方案

The answer I found for this was to change the font size based on the media width, and once the font size was big enough to be readable on the mobile device I was using, it stopped suggesting the simplified view. The exact code used was:

@media (max-width: 540px) {
    body {
        font-size:18px !important;
    }
}

Simple enough.

这篇关于禁止在Chrome上显示简化视图提示或使用简化视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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