samuelclay / NewsBlur

NewsBlur is a personal news reader that brings people together to talk about the world. A new sound of an old instrument.
http://www.newsblur.com
MIT License
6.92k stars 1k forks source link

Feed takes over my newsblur page #2

Closed adamgotterer closed 14 years ago

adamgotterer commented 14 years ago

I tried adding "http://twitter.com/" as a new feed and it somehow it discovered Scobleizer twitter page. Whenever I click on that particular feed item on the left column it redirects the browser window to "http://newsblur.com/reader/load_feed_page?feed_id=3575". I cant click on the item to delete it without it redirecting.

samuelclay commented 14 years ago

Thanks for commenting on this. This bug is a known issue. Every single New York Times feed does the same thing. It's part of their iFrame busting code.

I am considering employing an iFrame buster buster, but that should probably be a last resort. At the very least, if the original site view does not load, the feed view should load in its place. But that's hard to tell. I'm thinking of using a page unload event to record that the feed is busting out of the iframe.

This is a high priority and will hopefully be fixed soon. (The iPhone app is a bit higher in priority.)

Also, you can technically delete the feed by going into the "Manage Opinions" preference box on another feed, using the feed drop-down to select the problematic feed, and then deleting it from there. Obviously not even close to optimal, but it is a possibility. A real fix will be in the works shortly.

samuelclay commented 14 years ago

I am trying to figure out a way to have the feed auto-correct and only show the feed view when that happens. No perfect solution, but I'm trying to figure something out that works. Hopefully I'll have a solution up soon.

adamgotterer commented 14 years ago

Sounds great. Let me know when I should give it another try!

samuelclay commented 14 years ago

Guess what, it's fixed! Try it out on any NYTimes or Twitter sites. It doesn't 100% of the time (in my tests), but it comes pretty darn close, and it fixes the site so the next time you try to load it, it won't even have to bust the iframe.

adamgotterer commented 14 years ago

Awesome. How did you do it?

samuelclay commented 14 years ago

See http://github.com/samuelclay/NewsBlur/blob/master/media/js/newsblur/reader.js#L159. Effectively, I'm forcing a HTTP status code of 204 on window.onbeforeunload, causing the browser not to go anywhere. Then I make sure the feed's iframe is closed and the feed view is loaded (and saved).

samuelclay commented 14 years ago

This is a result of this paper on iframe busters: http://seclab.stanford.edu/websec/framebusting/framebust.pdf

adamgotterer commented 14 years ago

Interesting, thanks!