I'd like to open an url in a different window from the browser console and access to that window from the former window. This url is different from the one I'm working with and I'm the owener of both.
For example, let's suppose I'm in Mozilla in window 1 in http://localhost:3000, I open a window 2 in http://localhost:8000. If I save the window object in a variable, it appears to be blank:
>>> let newWin = window.open("http://localhost:8000","_blank","width=1000,height=800")
undefined
>>> newWin
Restricted
>>> newWin.document.URL
"about:blank"
While I want to get:
>>> newWin.document.URL
"http://localhost:8000/"
I checked several questions in StackOverflow and this should work, am I doing anything wrong? Is it even posible to perform?
My final purpose is to embed this code in a React component and access to its inner HTML. I'm first trying in the console but I must say that it is not working in the React component either.