-
Notifications
You must be signed in to change notification settings - Fork 0
Core 954 window help menu #103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Ha, maybe I should stash changes that are WIP before updating snapshots
These might change after rendering, in which case they should be set immediately if we were ready once before.
|
||
const handleMessage = (e: MessageEvent) => { | ||
const { source, data: { type } } = e; | ||
if (source !== popup.current) return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also enforce that the origin matches the popup origin?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jivey I am not sure we can check that if the popup is cross-origin. I am getting this error when I try :
Uncaught SecurityError: Failed to read a named property 'origin' from 'Window': Blocked a frame with origin "..." from accessing a cross-origin frame.
Granted, I think this would share the same origin as the chat embed popup in a real situation (but there's no guarantee of that since the path is passed in).
Is there a reason to compare the origin too? I would have thought that comparing the objects directly would be most secure. It's effectively checking if the message is from the window the help menu opened, right?
https://openstax.atlassian.net/browse/CORE-954
Remote-controlled chat.