I have a local website containing pop-up windows that should be able to access their parents.
Those pop-up windows are opened as seen here:
open("filename.html", 'name', 'scrollbars=yes,width=700');
And I am trying to set them to access their parent window with window.opener
property.
This works fine on Firefox, but not on Chrome, where I get an error:
Uncaught DOMException: Blocked a frame with origin "null" from accessing a cross-origin frame.
I've also noticed that when being uploaded to a server it just works fine on both Chrome and Firefox.
How can I make this work on Chrome when running on local? Is there any alternative to window.opener
that allows the child window to acces their parent?
I'm having the same problem with a project... My temporal-solution was to set up a local server, for example:
Download http-server:
$ npm install http-server -g
Look for the project main folder in the console and type:
$ http-server
The console will show you in which port you can run your website in local
Now you can use window.opener in Chrome. I'd like to have a better solution!
By the way, another idea is replacing child-windows for modals :)