Index: src/JsEngine.cpp |
=================================================================== |
--- a/src/JsEngine.cpp |
+++ b/src/JsEngine.cpp |
@@ -23,6 +23,7 @@ |
#include "JsError.h" |
#include "Scheduler.h" |
#include "Utils.h" |
+#include "WebRequestJsObject.h" |
const AdblockPlus::ImmediateSingleUseThreadType AdblockPlus::ImmediateSingleUseThread = {}; |
@@ -109,8 +110,15 @@ |
*/ |
const v8::Context::Scope contextScope(GetContextAsLocal()); |
auto globalObject = GetGlobalObject(); |
+ // Timeout |
auto propertyName = AdblockPlus::Utils::ToV8String(GetIsolate(), "setTimeout"); |
globalObject->Set(propertyName, MakeCallback(::CallbackForSetTimeout)); |
+ // Web request |
+ auto auxiliaryObject = v8::Object::New(); |
+ propertyName = AdblockPlus::Utils::ToV8String(GetIsolate(), "GET"); |
+ auxiliaryObject->Set(propertyName, MakeCallback(::GETCallback)); |
+ propertyName = AdblockPlus::Utils::ToV8String(GetIsolate(), "_webRequest"); |
+ globalObject->Set(propertyName, auxiliaryObject); |
// TODO: Move the rest of the global object initializations here |
} |