visit
The 'blocked a frame with origin "null" from accessing a cross-origin frame` error occurs because of `Cross-originn`
request. To resolve this error, you have a number of solutions like using a `local web server`
or using a browser with cross domain web security
disabled few solutions to numbers.
This article will discuss all the solutions to solve cross-origin issues.
So accessing <frames>
directly from your browser without using a web service is not permitted for security reasons, if you could do this then it would be a major security vulnerability.
The following is the error message you are getting:
DOMException: Blocked a frame with origin "null" from accessing a cross-origin frame. error.
Remember that the same-origin policy prevents scripts from accessing the content of sites with different origins, and you can securely enable cross-origin communication between Window objects by using window.postMessage()
.
`postMessage(message, targetOrigin)``postMessage(message, targetOrigin, [transfer])`
Please keep in mind that turning off the same-origin policy (CORS) will only affect your browser. Also, disabling same-origin security settings in a browser allows any website to access cross-origin resources, which is extremely risky and should only be done for development purposes. Only window.postMessage()
now is the best way to interact between frames/iframes.