File tree Expand file tree Collapse file tree 1 file changed +1
-1
lines changed Expand file tree Collapse file tree 1 file changed +1
-1
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ const VERSION = '3.6.0';
30
30
31
31
// Check if various APIs are available (depends on environment)
32
32
const IS_BROWSER_ENV = typeof window !== "undefined" && typeof window . document !== "undefined" ;
33
- const IS_WEBWORKER_ENV = typeof self !== "undefined" && self . constructor ?. name === 'DedicatedWorkerGlobalScope' ;
33
+ const IS_WEBWORKER_ENV = typeof self !== "undefined" && ( [ 'DedicatedWorkerGlobalScope' , 'ServiceWorkerGlobalScope' , 'SharedWorkerGlobalScope' ] . includes ( self . constructor ?. name ) ) ;
34
34
const IS_WEB_CACHE_AVAILABLE = typeof self !== "undefined" && 'caches' in self ;
35
35
const IS_WEBGPU_AVAILABLE = typeof navigator !== 'undefined' && 'gpu' in navigator ;
36
36
const IS_WEBNN_AVAILABLE = typeof navigator !== 'undefined' && 'ml' in navigator ;
You can’t perform that action at this time.
0 commit comments