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

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

问题描述

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

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.

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

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.

总结:

  1. 如何防止出现显示简化视图"提示或
  2. 否则,我该如何设置我的网站以使用简化视图?

推荐答案

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

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;
    }
}

足够简单.

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

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