Created
September 7, 2019 07:28
-
-
Save mizchi/8620e870ef043e37b93af5fb668c3903 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "regenerator-runtime/runtime"; | |
const tx = document.createElement("textarea") as HTMLTextAreaElement; | |
document.body.appendChild(tx); | |
const btn = document.createElement("button"); | |
btn.textContent = "start"; | |
document.body.appendChild(btn); | |
btn.addEventListener("click", async (ev: any) => { | |
// @ts-ignore | |
const fileHandler = await window.chooseFileSystemEntries(); | |
const file = await fileHandler.getFile(); | |
tx.value = await file.text(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment