I am currently trying to build a little chrome extension that needs to get the HTML source code of an external webpage.
To achieve getting the HTML code, I first tried the casual way with the XMLHttpRequest, but I'm facing the Same Origin Policy since it is another domain.
I tried to search for a solution on StackOverflow and found this topic discussing the same subject: Can Javascript read the source of any web page?.
The thing is the YQL is no longer supported and the Jquery solution can grab the page you want but you need to do it via the proxy of your domain, and since I'm trying to do that in a chrome extension, I don't have any server and proxy to use.
How would you do it guys?
EDIT: I did a mistake explaining my problem: In my memory, the problem with the XMLHttpRequest was the Same-Origin-Policy, but I just tried again to do it and it turns out it is the CORS policy :
Error : Access to XMLHttpRequest at 'https://www.mozilla.org/' (redirected from 'http://www.mozilla.org/') from origin 'chrome-extension://mllkahpgmeneacfkpplnapkplfciefjc' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.