R
R
romasovest2017-08-27 15:18:37
JavaScript
romasovest, 2017-08-27 15:18:37

How to disable cross domain js ban?

I want to parse the MTS website in JS from the browser. It is necessary that this code works from any or at least a predefined domain.

var MTS = window.open("https://login.mts.ru", "MTS");
setTimeout(function(){ // onload не слушается, пока что будет таймер
  console.log(MTS.document.body.innerHTML); // забираем body
},5000);

Googled that some browser extensions solve this problem. but none of them helped me. Apparently I'm doing something wrong. Please explain on your fingers what to download and how to run so that cross-domain materializes.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Serezha, 2017-08-27
@romasovest

https://chrome.google.com/webstore/detail/allow-co...
UPD:
Under windows, create a shortcut, or run from cmd

chrome.exe --user-data-dir="C:/Chrome dev session" --disable-web-security

On Linux, after killing all chrome processes:
chromium-browser --disable-web-security

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question