diff --git a/www/src/builtin_modules.js b/www/src/builtin_modules.js
index <HASH>..<HASH> 100644
--- a/www/src/builtin_modules.js
+++ b/www/src/builtin_modules.js
@@ -299,6 +299,11 @@
 
             return obj
         })(__BRYTHON__)
+    }else{
+        // In a web worker, name "window" is not defined, but name "self" is
+        delete browser.$$window
+        delete browser.win
+        browser.self = $B.win
     }
 
     modules['browser'] = browser
@@ -529,6 +534,4 @@
 
     $B.set_func_names($B.cell, "builtins")
 
-
-
 })(__BRYTHON__)
In a web worker, browser has no attribute "window" but has an attribute "self"