Skip to content
This repository has been archived by the owner on Sep 9, 2021. It is now read-only.

fix: make inline workers work from IE/Edge legacy #316

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/runtime/inline.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,13 @@ module.exports = (content, workerConstructor, workerOptions, url) => {
workerOptions
);

URL.revokeObjectURL(objectURL);
// URL.revokeObjectUrl shouldn't be called immediately after Worker creation on IE and Edge legacy.
// Worker will be forked but the script will not be executed and there are no error event or runtime exceptions for this.
if (globalScope.setImmediate) {
globalScope.setImmediate(() => URL.revokeObjectURL(objectURL));
} else {
URL.revokeObjectURL(objectURL);
}

return worker;
} catch (e) {
Expand Down