DaniGuardiola / rpc-anywhere

Create a type-safe RPC anywhere.
https://rpc-anywhere.dio.la
MIT License
168 stars 1 forks source link

Failed to read a named property 'href' from 'Location': Blocked a frame with origin "http://localhost:3000" from accessing a cross-origin frame. #29

Open phanmn opened 3 months ago

phanmn commented 3 months ago

In which versions of the package (and relevant enviroment tools such as Node.js) have you observed the bug?

1.7.0

What steps will reproduce the bug?

Try to use iframe with different origin

What behavior did you expect?

No more error

What actually happened?

Failed to read a named property 'href' from 'Location': Blocked a frame with origin "http://localhost:3000" from accessing a cross-origin frame.

Workaround

No response

Proposed fix

Fix waitForLoad function, which is reading contentWindow?.location.href

Other remarks

No response

Contribution

DaniGuardiola commented 3 months ago

What would you propose instead? The iframe system needs a way to check that the iframe is ready. You can also use the lower level transport if that unblocks you, btw.