How to disable firefox's reader view from my website?

一笑奈何 提交于 2019-12-04 14:22:57

问题


Today i updated my firefox to the latest version and one big feature is the reader view for desktop. We launched a webshop two weeks ago and now there is this tiny "reader view" icon. When i click on it i get an error-message. My team-leader wants me to remove this feature when visiting this site.

is it possible to remove or hide the "reader view" feature from firefox when visiting my site?


回答1:


There is currently no legit way of disabling Reader View for your website. Reader View is supposed to automatically detect on what pages it should be available and on what pages it should not.

If there is an issue with your website, your best option is probably to report it there: https://github.com/mozilla/readability/issues

You can also find more info about the issues affecting Reader View in Firefox there: https://wiki.mozilla.org/QA/Reader_view

Although I would not recommend it, there might be a way to fool Reader View into thinking it should not parse your website, if you really need to. A quick look at the source code reveals that it will not parse certain type of documents, certain URIs and malformed URLs. You would need to dig in the source to understand how/if your site can safely be adapted to avoid being parsed. The Reader View source code can be found here: https://mxr.mozilla.org/mozilla-release/source/toolkit/components/reader/ReaderMode.jsm or https://dxr.mozilla.org/mozilla-release/source/toolkit/components/reader/ReaderMode.jsm




回答2:


There is no way of forcing disabling the Reader View to the user, But if it is important to your site, you can notify the user to disable or not use the reader feature of firefox.

This would be the way to Disable the Reader on the users browser

  • in the Enter about:config in browser address bar
  • click the "I'll be careful I promise" box
  • search for reader.parse-on-load.enabled
  • toggle preference to false (right click > toggle to false )
  • close the about:config page > refresh browser > reader view icon has gone



回答3:


This Question shows how to Optimize website to show reader view in Firefox. So you have to ensure that your site is not optimized for the Reader View.

Don't use formatting options that are favoured for the Reader View and so on.

I guess this will suffice:

  • Don't use the <p> Tag
  • write all Textblocks in small portions

Here are some more details about the mechanism




回答4:


put this code on your css code and you are done !

/* CSS Reset */
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,
p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,
img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,
dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,
thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,
footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,
audio,video,adnav,adheader{
    margin:0;
    padding:0;
    border:0;
    font-size:100%;
    font:inherit;
    vertical-align:baseline;
}


来源:https://stackoverflow.com/questions/30615447/how-to-disable-firefoxs-reader-view-from-my-website

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!