兼容PointerEvent与MouseEvent

解决PointerEvent中没有e.path的问题

// ==UserScript==
// @name         兼容PointerEvent与MouseEvent
// @version      1.0
// @description  解决PointerEvent中没有e.path的问题
// @author       期期
// @match        *
// @grant        none
// @namespace https://greasyfork.org/users/1240077
// ==/UserScript==

(function() {
    'use strict';
    window.addEventListener("click",e=>e.path=e.path||[e.target],true)
    // Your code here...
})();