electron/spec/fixtures/pages/mouse-events.html
trop[bot] bb09671746
feat: allow intercepting mouse events (#47365)
* feat: allow intercepting mouse events

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* test: add specs

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* Update spec/api-web-contents-spec.ts

Co-authored-by: David Sanders <dsanders11@ucsbalum.com>

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2025-06-05 18:35:33 +02:00

20 lines
No EOL
561 B
HTML

<html>
<body>
<input type="text" id="input" autofocus />
<script type="text/javascript" charset="utf-8">
const { ipcRenderer } = require('electron')
document.onmousedown = function (e) {
ipcRenderer.send('mousedown', e.button, e.x, e.screenX, e.y, e.screenY)
}
document.onmouseup = function (e) {
ipcRenderer.send('mouseup', e.button, e.x, e.screenX, e.y, e.screenY)
}
document.onmousemove = function (e) {
ipcRenderer.send('mousemove', e.button, e.x, e.screenX, e.y, e.screenY)
}
</script>
</body>
</html>