From a245d4707ef65a5326d9325efb67e224cb057822 Mon Sep 17 00:00:00 2001 From: Thai Pangsakulyanont Date: Mon, 17 Feb 2020 14:49:28 +0700 Subject: [PATCH] Do not use postMessage on file:// protocols Fixed #770 --- packages/core-js/internals/task.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core-js/internals/task.js b/packages/core-js/internals/task.js index 834585fe5a9a..459a01923a75 100644 --- a/packages/core-js/internals/task.js +++ b/packages/core-js/internals/task.js @@ -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-