mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-22 02:52:52 +00:00
32 lines
829 B
HTML
32 lines
829 B
HTML
<input id="input1" type="file" multiple />
|
|
<script src="../include.js"></script>
|
|
<script>
|
|
const runTest = async id => {
|
|
let input = document.getElementById(id);
|
|
|
|
return new Promise(resolve => {
|
|
input.addEventListener("input", async () => {
|
|
println(`${id}:`);
|
|
|
|
let files = structuredClone(input.files);
|
|
|
|
for (let file of input.files) {
|
|
const text = await file.text();
|
|
|
|
println(`${file.name}: ${file.type}: ${text}`);
|
|
}
|
|
|
|
resolve();
|
|
});
|
|
|
|
internals.dispatchUserActivatedEvent(input, new Event("mousedown"));
|
|
input.showPicker();
|
|
});
|
|
}
|
|
|
|
asyncTest(async done => {
|
|
await runTest("input1");
|
|
|
|
done();
|
|
});
|
|
</script>
|