瀏覽代碼

Merge pull request #8057 from brianzinn/master

fix: Web Workers have no window
David Catuhe 5 年之前
父節點
當前提交
1306551052
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/Offline/database.ts

+ 1 - 1
src/Offline/database.ts

@@ -92,7 +92,7 @@ export class Database implements IOfflineProvider {
     }
 
     private static _ReturnFullUrlLocation = (url: string): string => {
-        if (url.indexOf("http:/") === -1 && url.indexOf("https:/") === -1) {
+        if (url.indexOf("http:/") === -1 && url.indexOf("https:/") === -1 && typeof window !== "undefined") {
             return (Database._ParseURL(window.location.href) + url);
         }
         else {