WICG / capability-delegation

An API to allow developers transfer the ability to use restricted APIs to any target window in the frame tree.
Other
14 stars 7 forks source link

Consider extending MessageEvent #25

Open miketaylr opened 2 years ago

miketaylr commented 2 years ago

It may be useful to pass additional information to the receiver via the MessageEvent, so a developer can know that delegation failed, or was denied or something similar.

window.addEventListener("message", e => {
  if (e.delegate == false) {
    // do something useful, rather than hope the API i would have called has a rejection handler (or w/e)
 }
});