Some websites break iframe embedding

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

var parent_location = parent.location.href.toLowerCase(); <br />
if(parent){ <br />
if ( top.location.href.toLowerCase() !=
<br />
     document.location.href.toLowerCase()){ <br />
 if(parent_location.indexOf('{http://www.aptgetupdate.de}')
<br />
    != 0 ){ <br />
  top.location.href = document.location.href; <br />
 } <br />
} <br />
} <br /> } <br /> catch ( err ){ <br />
if(typeof window.console != "undefined"){ <br />
console.log(err); <br />
} <br />
top.location.href = document.location.href; <br /> } <br /><br /> if (parent.frames.length > 0)
<br />
top.location.replace(document.location) <br /> </script>```
1 Like

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.

1 Like

Nice. So the linked code is already in use? I think this topic is solved then. :slight_smile: