browser-compat-data icon indicating copy to clipboard operation
browser-compat-data copied to clipboard

The second param of Window.postMessage might not be optional

Open zhangzhuang15 opened this issue 1 year ago • 3 comments

MDN URL

https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage#options

What specific section or headline is this issue about?

No response

What information was incorrect, unhelpful, or incomplete?

Second param of Window.postMessage, whose name is "options" or "targetOrigin", is optional according to the MDN doc.But it's not really true.If I ignore the second param in chrome v69, there's an error: "Failed to execute 'postMessage' on 'Window': 2 arguments required, but only 1 present."

Instead, I do same thing in chrome v123, everything is ok.

What did you expect to see?

Add a pitfall that tells people in which case the second param is not optional.

Do you have any supporting links, references, or citations?

No response

Do you have anything more you want to share?

No response

zhangzhuang15 avatar May 22 '24 11:05 zhangzhuang15

this might be an issue relates to BCD

skyclouds2001 avatar May 22 '24 19:05 skyclouds2001

BCD? What doest it mean ? @skyclouds2001

zhangzhuang15 avatar May 23 '24 05:05 zhangzhuang15

I mean this might better to documented in browser compat data

skyclouds2001 avatar May 23 '24 08:05 skyclouds2001