mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-14 23:22:52 +00:00
21 lines
685 B
HTML
21 lines
685 B
HTML
<script src="../include.js"></script>
|
|
<script>
|
|
asyncTest((done) => {
|
|
const workerScript = `
|
|
self.onmessage = function(evt) {
|
|
self.postMessage('WHF! :^)');
|
|
};
|
|
`;
|
|
const blob = new Blob([workerScript], { type: 'application/javascript' });
|
|
const workerScriptURL = URL.createObjectURL(blob);
|
|
const worker = new Worker(workerScriptURL);
|
|
|
|
worker.onmessage = function(evt) {
|
|
println('Message received from worker: ' + JSON.stringify(evt.data));
|
|
done();
|
|
};
|
|
|
|
// Send a message to the worker
|
|
worker.postMessage('Hello from main script');
|
|
});
|
|
</script>
|