mdn / browser-compat-data

This repository contains compatibility data for Web technologies as displayed on MDN
https://developer.mozilla.org
Creative Commons Zero v1.0 Universal
4.85k stars 1.94k forks source link

Window.postMessage: options parameter required on older browsers #23161

Open zhangzhuang15 opened 1 month ago

zhangzhuang15 commented 1 month ago

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

skyclouds2001 commented 1 month ago

this might be an issue relates to BCD

zhangzhuang15 commented 1 month ago

BCD? What doest it mean ? @skyclouds2001

skyclouds2001 commented 1 month ago

I mean this might better to documented in browser compat data