mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 09:45:06 +02:00
Instead of defining somewhat high level mouse actions, allow granular control of mouse clicks and mouse down/up/move events. We will want to simulate things like holding down a mouse button after double clicking and then dragging the mouse to another position in the future, and this enables that.
30 lines
798 B
HTML
30 lines
798 B
HTML
<!DOCTYPE html>
|
|
<iframe id="iframe"></iframe>
|
|
<input id="input" />
|
|
<script src="../include.js"></script>
|
|
<script>
|
|
asyncTest(done => {
|
|
let iframe = document.getElementById("iframe");
|
|
let input = document.getElementById("input");
|
|
|
|
input.addEventListener("change", () => {
|
|
println(input.value);
|
|
done();
|
|
});
|
|
|
|
iframe.onload = () => {
|
|
internals.mouseMove(20, 40);
|
|
internals.mouseDown(20, 40);
|
|
|
|
iframe.onload = () => {
|
|
internals.sendText(input, "wfh :^)");
|
|
internals.commitText();
|
|
};
|
|
|
|
iframe.src = "data:text/html,<p contenteditable>Text 2</p>";
|
|
};
|
|
|
|
iframe.src = "data:text/html,<p contenteditable>Text 1</p>";
|
|
});
|
|
</script>
|