https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 1d80ed8c6e3c70dc91ecdc3942cf736c974e2490 authored by Behind The Math on 05 April 2018, 03:02:14 UTC
Add tests to check that the User-Agent header is set for XHR requests
Tip revision: 1d80ed8
buildInlineWorker.js
(function ()
{
 var workerSource = document.getElementById('inlineWorker');
 var blob = new Blob([workerSource.textContent]);

 // can I create a new script tag like this? ack...
 var url = window.URL.createObjectURL(blob);

 try {
   var worker = new Worker(url);
 }
 catch (e) {
   done();
 }

 worker.addEventListener('message', function(e) {
   assert_unreached("script ran");
 }, false);

 worker.postMessage('');
})();
back to top