greglebreton 4e8a693745
Some checks failed
continuous-integration/drone/push Build is failing
add garagenum exp + maj url site projets
2023-01-08 16:50:31 +01:00

15 lines
573 B
JavaScript

"use strict";
module.exports = function (workerUrl, origin, isESM) {
if (origin === self.location.origin) {
// If the worker bundle's url is on the same origin as the document,
// use the worker bundle's own url.
return workerUrl;
} else {
// Otherwise, create a blob URL which loads the worker bundle with `importScripts`.
var source = isESM ? 'import ' + JSON.stringify(workerUrl) + ';' : 'importScripts(' + JSON.stringify(workerUrl) + ');';
return URL.createObjectURL(new Blob([source], {
type: 'application/javascript'
}));
}
};