diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /mobile/android/geckoview/src/androidTest/assets/www/forms_iframe.html | |
parent | Initial commit. (diff) | |
download | firefox-esr-upstream.tar.xz firefox-esr-upstream.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mobile/android/geckoview/src/androidTest/assets/www/forms_iframe.html')
-rw-r--r-- | mobile/android/geckoview/src/androidTest/assets/www/forms_iframe.html | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/mobile/android/geckoview/src/androidTest/assets/www/forms_iframe.html b/mobile/android/geckoview/src/androidTest/assets/www/forms_iframe.html new file mode 100644 index 0000000000..2c0ef7dff5 --- /dev/null +++ b/mobile/android/geckoview/src/androidTest/assets/www/forms_iframe.html @@ -0,0 +1,58 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8" /> + <title>Forms iframe</title> + <meta name="viewport" content="minimum-scale=1,width=device-width" /> + </head> + <body> + <form id="form1"> + <input type="text" id="user1" value="foo" /> + <input type="password" id="pass1" value="foo" /> + <input type="email" id="email1" value="@" /> + <input type="number" id="number1" value="0" /> + <input type="tel" id="tel1" value="0" /> + <input type="submit" value="submit" /> + </form> + <input type="Text" id="user2" value="foo" /> + <input type="PassWord" id="pass2" maxlength="8" value="foo" /> + <input type="button" id="button1" value="foo" /> + <input type="checkbox" id="checkbox1" /> + <input type="search" id="search1" /> + <input type="url" id="url1" /> + <input type="hidden" id="hidden1" value="foo" /> + </body> + <script> + const params = new URL(document.location).searchParams; + + function getEventInterface(event) { + if (event instanceof document.defaultView.InputEvent) { + return "InputEvent"; + } + if (event instanceof document.defaultView.UIEvent) { + return "UIEvent"; + } + if (event instanceof document.defaultView.Event) { + return "Event"; + } + return "Unknown"; + } + + function getData(key, value) { + return new Promise(resolve => + document.querySelector(key).addEventListener( + "input", + event => { + resolve([key, event.target.value, value, getEventInterface(event)]); + }, + { once: true } + ) + ); + } + + window.addEventListener("message", async event => { + const { data, source, origin } = event; + source.postMessage(await getData(data.key, data.value), origin); + }); + </script> +</html> |