Skip to content

Commit

Permalink
Do not use postMessage on file:// protocols
Browse files Browse the repository at this point in the history
  • Loading branch information
dtinth authored Feb 17, 2020
1 parent 4546ffe commit a245d47
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core-js/internals/task.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ if (!set || !clear) {
defer = bind(port.postMessage, port, 1);
// Browsers with postMessage, skip WebWorkers
// IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
} else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts && !fails(post)) {
} else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts && !fails(post) && location.protocol !== 'file:') {
defer = post;
global.addEventListener('message', listener, false);
// IE8-
Expand Down

0 comments on commit a245d47

Please sign in to comment.