Some websites break iframe embedding

  • 1
  • Problem
  • Updated 8 years ago
Some websites break iframe embedding by checking the windows url and redirect to their original web address. That seems legit but breaks the "original" view in NewsBlur.

Easiest workaround is to use the feed or story view, but I think the original view is what makes NewsBlur special.

Maybe this could be filtered, e.g. check for the variable "top.location.href" in JavaScript. Sadly this means performance losses.

Example website: aptgetupdate.de
<script type='text/javascript'>

try{
var parent_location = parent.location.href.toLowerCase();
if(parent){
if ( top.location.href.toLowerCase() !=
document.location.href.toLowerCase()){
if(parent_location.indexOf('{http://www.aptgetupdate.de}')
!= 0 ){
top.location.href = document.location.href;
}
}
}
}
catch ( err ){
if(typeof window.console != "undefined"){
console.log(err);
}
top.location.href = document.location.href;
}

if (parent.frames.length > 0)
top.location.replace(document.location)
</script>
Photo of e2b

e2b

  • 29 Posts
  • 1 Reply Like

Posted 8 years ago

  • 1
Photo of Samuel Clay

Samuel Clay, Official Rep

  • 6514 Posts
  • 1474 Reply Likes
Already happening. See NewsBlur's iframe buster buster: https://github.com/samuelclay/NewsBlu....

And you're right, there is a performance penalty. But it's not huge.

This covers about 95% of cases. There are some websites that do a much better job of iframe busting. For those few sites, you'll have to read in the Feed view. If you're having trouble forcing the site to use the Feed view because the Original view keeps booting you, just right-click on the site and go to Site Settings.

By the way, just as an important note, NewsBlur's iframe buster buster complies with the wishes of the website and simply prevents NewsBlur from being hijacked. It then moves you to the Feed view if possible. The Original view cannot be used with those sites. I wish I made some sort of nice detection system for figuring out which feeds just do not work in the Original view. It's a planned feature for one of these days.
Photo of e2b

e2b

  • 29 Posts
  • 1 Reply Like
Nice. So the linked code is already in use? I think this topic is solved then. :)