Javascript:如何成为 mouse/key 事件的第一个接收者

Javascript: How to be the very first receiver of a mouse/key event

我想在任何其他对象有机会处理它之前识别网站内的任何鼠标输入。
对此有本地解决方案吗?

为什么我需要先得到它?
该站点对某些鼠标事件使用 event.stopPropagation()。我想在传播之前看到这些事件

备注:

您可以将useCaptureaddEventListener中的第三个参数)指定为true:

window.addEventListener('mousedown', function(){
  console.log("first")
})

window.addEventListener('mousedown', function(){
  console.log("second") //should fire first
}, true)

window.addEventListener('mousedown', function(){
  console.log("third")
})