color-scheme-js icon indicating copy to clipboard operation
color-scheme-js copied to clipboard

Use self instead of window to support Web Workers

Open trentmwillis opened this issue 4 years ago • 0 comments

Thanks for this library! I'd like to use it for a project that is using Web Workers. However, currently, it throws an error when it is loaded due to a reference to window, which isn't available in a Web Worker. Replacing this with self, which is available in both the main browser thread and Web Workers, fixes the issue and the library works perfectly!

trentmwillis avatar Jul 18 '19 03:07 trentmwillis