-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Open
Labels
addition/proposalNew features or enhancementsNew features or enhancementsneeds implementer interestMoving the issue forward requires implementers to express interestMoving the issue forward requires implementers to express interesttopic: workers
Description
Currently, the advised way to feature-detect support for new Worker({type: "module"})
is to create an options object and see if the .type
property gets accessed by the constructor with a getter:
let supportsModuleWorker = false;
const options = {
get type() {
supportsModuleWorker = true
}
};
new Worker("data:,", options).terminate();
That seems fairly convoluted. I propose adding type
property to module instances:
const w = new Worker("data:,", {type: "module"})
const supportsModuleWorker = "type" in w;
w.terminate();
developit
Metadata
Metadata
Assignees
Labels
addition/proposalNew features or enhancementsNew features or enhancementsneeds implementer interestMoving the issue forward requires implementers to express interestMoving the issue forward requires implementers to express interesttopic: workers