mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
f55471333b
We were passing the MIME type to the underlying Blob, but the factory for creating a File only checks an explicit options structure.
38 lines
1.1 KiB
HTML
38 lines
1.1 KiB
HTML
<input id="input1" type="file" />
|
|
<input id="input2" type="file" multiple />
|
|
<script src="./include.js"></script>
|
|
<script type="text/javascript">
|
|
const runTest = async id => {
|
|
let input = document.getElementById(id);
|
|
|
|
return new Promise(resolve => {
|
|
input.addEventListener("input", async () => {
|
|
println(`${id}:`);
|
|
|
|
for (let i = 0; i < input.files.length; ++i) {
|
|
const file = input.files.item(i);
|
|
const text = await file.text();
|
|
|
|
println(`${file.name} (index iteration): ${file.type}: ${text}`);
|
|
}
|
|
|
|
for (let file of input.files) {
|
|
const text = await file.text();
|
|
|
|
println(`${file.name} (for..of iteration): ${file.type}: ${text}`);
|
|
}
|
|
|
|
resolve();
|
|
});
|
|
|
|
internals.dispatchUserActivatedEvent(input, new Event("mousedown"));
|
|
input.showPicker();
|
|
});
|
|
};
|
|
|
|
asyncTest(async done => {
|
|
await runTest("input1");
|
|
await runTest("input2");
|
|
done();
|
|
});
|
|
</script>
|