function startWorker() {
// We use a Blob for the worker content to avoid an external JS file, and data
// URLs seem to be blocked in a chrome environment.
const workerContent = new Blob(
[ workerCode ],
{ type: "application/javascript" }
);
const blobURL = URL.createObjectURL(workerContent);
// We start a worker and then terminate it right away to trigger our bug.
info("Starting the worker...");
const myWorker = new Worker(blobURL);
return { worker: myWorker, url: blobURL };
}
function workload() {
const { worker, url } = startWorker();
return new Promise(resolve => {
worker.onmessage = () => {
info("Got a message, terminating the worker.");
worker.terminate();
URL.revokeObjectURL(url);
resolve();
};
});
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.