A lot of webmasters use the Access-Control-Allow-Origin header in order not to have their content displayed somewhere else on the web. It is quite understandable as they want to have their intellectual property protected. But sometimes it might be useful to have some website loaded into an iframe although the iframe is quite old-fashioned HTML element.
In order to do so I found interesting service called WhateverOrigin.org (which is an open Source clone of similar service called AnyOrigin.com). It just grabs content from a website specified in GET parameter and returns it together with HTTP status code as JSON data. With this approach you don’t point iframe to the target site like
but to some HTML page located at your server called eg. loader.html:
This page contains simple script which loads page’s content, replaces relative links in images and links to absolute ones and displays it:
This little example shows the whole thing in action.
It might be useful to remove Google Analytics code and some other stuff.