0

I have an application where you need to give permission to access files. The user clicks a button which opens a pop up window for the user to log in and allow access. The pop up window then redirects to a url which contains a code. I need to get this code from the url, so I can then send it to my API.

The issue I am having is I continue to get this error:

Uncaught DOMException: Blocked a frame with origin "http://localhost:3000" from accessing a cross-origin frame.

A preview of the code is as follows:

var windowReference;
    const openAccessWindow = async () => {
        if (windowReference == null || windowReference.closed) {
            windowReference = window.open(
                'https://sandbox-api.some_more_information',
                'Records', 'popup');
console.log(windowReference.location.href);

        } else {
            windowReference.focus()
        }
    }

Ruvee
  • 8,611
  • 4
  • 18
  • 44
Hilary
  • 11
  • 3
  • I don't see any frames in your code, but since you mentioned them, read this: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#scripting – Randy Casburn Nov 29 '21 at 21:26
  • If that isn't helpful read this: https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy – Randy Casburn Nov 29 '21 at 21:29
  • @RandyCasburn So I actually don't use an frame anywhere. this is the only area i create the pop up window. – Hilary Nov 29 '21 at 21:48

0 Answers0