Browse Source

REPORT-83708 fix: worker对safari浏览器12以下版本做处理

research/test
Sylar 2 years ago
parent
commit
10846491f0
  1. 12
      src/core/platform/web/function.js
  2. 1
      typescript/core/platform/web/function.ts
  3. 3
      typescript/core/worker/controller/worker.main_thread.controller.ts

12
src/core/platform/web/function.js

@ -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;
}
return 0;
}
});

1
typescript/core/platform/web/function.ts

@ -9,4 +9,5 @@ export type _function = {
isMac: () => boolean;
isWindows: () => boolean;
isSupportCss3: (style: any) => boolean;
getSafariVersion: () => number;
}

3
typescript/core/worker/controller/worker.main_thread.controller.ts

@ -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

Loading…
Cancel
Save