mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-22 09:45:41 +00:00
76862dadad
They are non-standard aliases for "DragEvent" and "KeyboardEvent" that are not supported by any other UA, and we would like to drop support. So first let's stop using them ourselves, so we can use telemetry to see if any sites are using them. MozReview-Commit-ID: ICC33ORa2st
33 lines
903 B
HTML
33 lines
903 B
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
</head>
|
|
<body>
|
|
<script>
|
|
window.addEventListener("Test:DispatchKeyEvents", aEvent => {
|
|
var keyCode = KeyEvent["DOM_" + aEvent.detail.code];
|
|
|
|
document.body.focus();
|
|
var evt = document.createEvent("KeyboardEvent");
|
|
evt.initKeyEvent("keydown", true, true, window,
|
|
false, false, false, false,
|
|
keyCode, 0);
|
|
document.body.dispatchEvent(evt);
|
|
|
|
evt = document.createEvent("KeyboardEvent");
|
|
evt.initKeyEvent("keypress", true, true, window,
|
|
false, false, false, false,
|
|
keyCode, 0);
|
|
document.body.dispatchEvent(evt);
|
|
|
|
evt = document.createEvent("KeyboardEvent");
|
|
evt.initKeyEvent("keyup", true, true, window,
|
|
false, false, false, false,
|
|
keyCode, 0);
|
|
document.body.dispatchEvent(evt);
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|