mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
15 lines
471 B
HTML
15 lines
471 B
HTML
![]() |
<head>
|
||
|
<script>
|
||
|
async function loadFile() {
|
||
|
const [fileHandle] = await window.showOpenFilePicker();
|
||
|
const file = await fileHandle.getFile();
|
||
|
const contents = await file.text();
|
||
|
document.getElementById('contents').textContent = contents
|
||
|
}
|
||
|
</script>
|
||
|
</head>
|
||
|
<body>
|
||
|
<button onclick="loadFile()">Open File</button>
|
||
|
<p>Pick a text file and its contents will be shown below</p>
|
||
|
<textarea id="contents" placeholder="File contents"></textarea>
|
||
|
</body>
|