@ -125,5 +125,17 @@ BI._.extend(BI, {
}
return false;
},
getSafariVersion: function () {
if (!_global.navigator) {
return 0;
var agent = navigator.userAgent.toLowerCase();
var version = agent.match(/version\/([\d.]+)/);
if (version && version[1]) {
return version[1] * 1;
});
@ -9,4 +9,5 @@ export type _function = {
isMac: () => boolean;
isWindows: () => boolean;
isSupportCss3: (style: any) => boolean;
getSafariVersion: () => number;
@ -10,9 +10,10 @@ export class WorkerMainThreadController extends WorkerBaseController {
/**
* 是否支持 new Worker, 默认为 Wroker Class 是否实现
* 由于Blob url支持度问题 规避Safari 12以下版本
*/
public canNewWorker: boolean = WorkerMainThreadController.hasWorkerClass;
public canNewWorker: boolean = WorkerMainThreadController.hasWorkerClass && !(BI.isSafari() && BI.getSafariVersion() < 12);
* 主线程 new Worker 起始时刻