Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/FilterEngine.cpp

Issue 11322004: Injecting libadblockplus into IE (libadblockplus side) (Closed)
Patch Set: Created July 29, 2013, 5:38 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/api.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/FilterEngine.cpp
===================================================================
--- a/src/FilterEngine.cpp
+++ b/src/FilterEngine.cpp
@@ -277,3 +277,20 @@
std::string error(params.size() >= 1 && !params[0]->IsNull() ? params[0]->AsString() : "");
callback(error);
}
+
+std::string FilterEngine::GetRequire(std::string requireName)
+{
+ JsValuePtr func = jsEngine->Evaluate("API.getRequire");
+ JsValueList params;
+ params.push_back(jsEngine->NewValue(requireName));
+ JsValuePtr requireContent = func->Call(params);
+
+ if (requireContent->IsString())
+ {
+ return requireContent->AsString();
+ }
+ else
+ {
+ return "";
+ }
+}
« no previous file with comments | « lib/api.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld