MouseEvent.prototype.x or MouseEvent.prototype.y not supported fix

for browsers that don't support MouseEvent.prototype.x or MouseEvent.prototype.y

当前为 2021-09-28 提交的版本,查看 最新版本

// ==UserScript==
// @name        MouseEvent.prototype.x or MouseEvent.prototype.y not supported fix
// @namespace   http://bzzzzdzzzz.blogspot.com/
// @description for browsers that don't support MouseEvent.prototype.x or MouseEvent.prototype.y
// @author      BZZZZ
// @include     *
// @version     0.1
// @grant       none
// @run-at      document-start
// ==/UserScript==

(function(d,g,p){
if(!p.hasOwnProperty("x"))d(p,"x",g(p,"clientX"));
if(!p.hasOwnProperty("y"))d(p,"y",g(p,"clientY"));
})(Object.defineProperty,Object.getOwnPropertyDescriptor,MouseEvent.prototype);