 +#endif
 +        "process.chdir(require('path').dirname(process.mainModule.filename));"
 +        "process.mainModule.paths = require('module')._nodeModulePaths(process.cwd());"
++
++        // Use WebKit's console and setTimeout globally
++        "global.console = console;"
++        "global.setTimeout = setTimeout;"
++        "global.clearTimeout = clearTimeout;"
++        "global.setInterval = setInterval;"
++        "global.clearInterval = clearInterval;"
 +    ));
 +    script->Run();
 +

diff --git a/Source/WebCore/WebCore.gyp/WebCore.gyp b/Source/WebCore/WebCore.gyp/WebCore.gyp
index f812f78..4b96eb7 100644
--- a/Source/WebCore/WebCore.gyp/WebCore.gyp
+++ b/Source/WebCore/WebCore.gyp/WebCore.gyp
@@ -57,6 +57,7 @@

     }
     if ($interfaceName eq "HTMLDocument") {
diff --git a/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp b/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp
index 2224c70..b933632 100644
--- a/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp
+++ b/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp
@@ -63,6 +63,9 @@
