-
Notifications
You must be signed in to change notification settings - Fork 12.8k
"postMessage" declartion in 'lib.dom.d.ts' may have a little problem #30042
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
Comments
Indeed optional according to the living "whatwg" specs. https://html.spec.whatwg.org/multipage/web-messaging.html#posting-messages "A target origin can be specified using the targetOrigin member of options. If not provided, it defaults to "/". This default restricts the message to same-origin targets only." The fix probably needs to come from https://github.com/Microsoft/TSJS-lib-generator |
OK,Thank you. |
The relevant location, I think, is: or, if |
Actually, as @saschanaz points out, https://html.spec.whatwg.org/multipage/window-object.html#the-window-object:dom-window-postmessage shows that the parameter targetOrigin is required. When you provide an options object instead, the options object has an optional property named targetOrigin. |
@saschanaz @sandersn could you please check it out again? The docs you linked to say:
which means |
@AviVahl I think @saschanaz fixed this in microsoft/TypeScript-DOM-lib-generator#679. Mind taking a look to see if that's the case? |
@sandersn issue does seem to be fixed in @saschanaz's PR. |
All thanks go to @saschanaz ! I am just a newbie in this space. |
Uh oh!
There was an error while loading. Please reload this page.
TypeScript Version: 3.3.3
postMessage
declartion inlib.dom.d.ts
isIts second parameter
targetOrigin
is set as a must.But I found samples on MDN about
postMessage
don't pass it.There may lack a
?
aftertargetOrigin
.When I set
use strict
of comile options true and don't passtargetOrigin
, compiler will warn me ,which makes me X﹏X.The text was updated successfully, but these errors were encountered: