Browse Source

Merge pull request #8057 from brianzinn/master

fix: Web Workers have no window
David Catuhe 5 years ago
parent
commit
1306551052
1 changed files with 1 additions and 1 deletions
  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 {