Browse Source

Merge pull request #3227 in VISUAL/fineui from DEC/fineui:release/11.0 to master

* commit '6e68964c98f375e0f21da00ac6afeaa70ef02074':
  REPORT-83708 fix: worker对safari浏览器12以下版本做处理
es6
Aeolus.Zhang-张敬峥 2 years ago
parent
commit
15879f09b2
  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