Hi there,
I noticed that SonarCloud is reporting false-positives for the following code:
window.addEventListener('pageshow', function (e) {
...
});
window.addEventListener('popstate', function (e) {
...
}
#3 HTMLMediaElement: playing and HTMLMediaElement: ended events
window.addEventListener('playing', onMediaFilePlay, true);
window.addEventListener('ended', onMediaFinished, true);
targetWindow.addEventListener('keydown', onKeyDown, true);
The error message is “Verify the message’s origin in this cross-origin communication”
However, for these examples, event.origin is ‘undefined’ as none of them listen to messages that are dispatched from window.postMessage.
Thanks.