mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-27 19:29:52 +00:00
22 lines
701 B
HTML
22 lines
701 B
HTML
<!DOCTYPE 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>
|