Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS access to Safari Reader feature through UIWebView

I am using iOS 4.3 & was wondering if there is any way that I can access the Safari's "Reader" feature through which webpages are removed of ads & other riff raff & the content takes the center stage.

If one opens any article in Safari (on say Wikipedia website), then a "Reader" button appears on the URL bar. Clicking on it presents a new window presenting the content beautifully.

How can I leverage this this functionality in iOS through UIWebView ?

enter image description here

PS: I know there is something called Readability Project. But I have no idea how to use this through UIWebView. Also for some websites Safari's Reader takes a call not to enable "Reader" feature, maybe it has no sufficient confidence?

like image 945
Srikar Appalaraju Avatar asked Oct 05 '11 06:10

Srikar Appalaraju


2 Answers

Important: THIS ANSWER NO LONGER WORKS!

Readability shut down on September 30, 2016.

Here is something they recommend as a replacement: https://mercury.postlight.com/web-parser/

Keeping the answer as a historical reference

--- Original answer ---

You can use Readability mobilizer for this. You will get a cleaned up version of any article, in the Readability styling:

http://www.readability.com/m?url=http://{URLOFTHEARTICLE}

Just prepare the URL and load it in your UIWebView. Here is how it looks in action:

http://www.readability.com/m?url=http%3A%2F%2Fwww.cnn.com%2F2013%2F01%2F11%2Fshowbiz%2Ftv%2Fgolden-globes-tv-vineyard%2Findex.html%3Fhpt%3Dhp_abar

like image 179
demosten Avatar answered Oct 19 '22 14:10

demosten


Apple is making a pretty big deal about the inclusion of "Reader" in iOS 5. I'm assuming by the noise it's not available in 4.3

re: How to use through UIWebView

  • I can't find any mention of it in the Web Content Guide.
  • There's nothing about it in the UIWebView class reference.
  • And there's nothing in QA1630.
like image 5
Alec Wenzowski Avatar answered Oct 19 '22 14:10

Alec Wenzowski