Browse Source

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

Merge in DEC/fineui from ~SYLAR/fineui:release/11.0 to release/11.0

* commit '3fd30cf9561602ff49dcb18ec1582f9522eaffca':
  REPORT-83708 fix: worker对safari浏览器12以下版本做处理
research/test
Sylar-黄山 2 years ago
parent
commit
6e68964c98
  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; 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; isMac: () => boolean;
isWindows: () => boolean; isWindows: () => boolean;
isSupportCss3: (style: any) => 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 * 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 * 线 new Worker

Loading…
Cancel
Save