blob: 0509972ae80cc77b6935a9f3980db9ba4cd570f6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
<script id="worker1" type="javascript/worker">
self.onmessage = async function(e) {
let a = await e.data[0].getFileHandle("c21deba4-fb73-4407-94f8-2e3782bf3f23", {"create": true})
self.close()
await a.createWritable({})
}
</script>
<script>
window.addEventListener("load", async () => {
let a = await self.clientInformation.storage.getDirectory()
const blob = new Blob([document.querySelector('#worker1').textContent], { type: "text/javascript" })
let worker = new Worker(window.URL.createObjectURL(blob))
worker.postMessage([a], [])
})
</script>
|