Answer the question
In order to leave comments, you need to log in
How to access data from adjacent browser window?
Good afternoon.
Non-standard task.
You need to access the data of the adjacent window in the browser in which the third-party site is open. This site is against being shown in frames and forbids access via JavaScript, gives the following errors:
Refused to display ' https://... ' in a frame because it set 'X-Frame-Options' to 'sameorigin'
Uncaught DOMException : Blocked a frame with origin " http://... " from accessing a cross-origin frame.
Taking it through Curl also does not work, since there is a captcha.
The most annoying thing is that I open it and see it on the screen of my computer. I just need to somehow programmatically read its content.
There must be some solution, including the most crooked one.
Answer the question
In order to leave comments, you need to log in
Non-standard task.
You need to access the data of the adjacent window in the browser in which the third-party site is open. This site is against being shown in frames and forbids access via JavaScript, gives such errors...
It also doesn't work to take it via Curl, because there is a captcha.
The most annoying thing is that I open it and see it on the screen of my computer. I just need to somehow programmatically read its content.
There must be some solution, including the most crooked one.
Browser extension.
If you are too lazy to bother with the extension, then you can make a bookmarklet with something like this:
javascript:(function(){
fetch("/save", { // адрес вашей "сохранялки"
method: "POST",
body: document.body.innerHTML
});
})();
Only if both sites are under your control, those.. you can add your code there!
If without problems - through your third-party service, GET HTTP requests, encoding the data you need in the parameters (up to 64kb after encoding).
Both sites must make requests to it with a mark, request data or receive.
Unfortunately, if you have https, your service must also use https.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question