Skip to content

Commit

Permalink
Merge pull request #771 from dtinth/patch-1
Browse files Browse the repository at this point in the history
Do not use postMessage on file:// protocols
  • Loading branch information
slowcheetah authored Mar 23, 2020
2 parents 4546ffe + 0ec69d6 commit a1a702e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/core-js/internals/task.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,13 @@ 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 a1a702e

Please sign in to comment.