JavaScript injection on third-party pages

I recently came across a website called Overlay101 , which allows you to create tours for other sites.

I was very interested to see the technique that they use to download third-party websites for editing.

When you enter a website address, it loads as a subdomain of overlay101.com.

For example, if I find /questions/7/how-do-javascript-closures-work - it loads as /questions/7/how-do-javascript-closures-work

I was wondering how this subdomain creation is achieved, and I saw in the source code the page that JavaScript entered. I was wondering how this is possible.

What intrigued me the most was that Stackoverflow.com doesn’t allow pages to be loaded within frames — I wondered how they managed to load the page to add tour pop-ups.

+6
source share
1 answer

They simply use wildcard DNS records to make all subdomains work. They then use the Host header to get the original domain name and download the site’s HTML code. Since they do this on the server side, they do not need frames, etc.

+1
source

All Articles