  FB::variant ActiveXBrowserHost::getVariant(const VARIANT *cVar)
  {
      CComVariant converted;
-diff -r 0600b313c115 src/ActiveXPlugin/ActiveXBrowserHost.h
---- a/src/ActiveXPlugin/ActiveXBrowserHost.h	Mon Feb 15 16:51:51 2010 +0200
-+++ b/src/ActiveXPlugin/ActiveXBrowserHost.h	Fri May 21 01:28:40 2010 +0300
-@@ -36,6 +36,7 @@
+diff -r b893f12eb85c src/ActiveXPlugin/ActiveXBrowserHost.h
+--- a/src/ActiveXPlugin/ActiveXBrowserHost.h	Mon May 10 14:15:18 2010 -0600
++++ b/src/ActiveXPlugin/ActiveXBrowserHost.h	Mon May 24 17:54:54 2010 +0300
+@@ -40,6 +40,7 @@
  public:
      FB::JSAPI_DOMDocument getDOMDocument();
      FB::JSAPI_DOMWindow getDOMWindow();

 
 protected:
     HWND m_hWnd;
@@ -49,4 +50,5 @@
     void getComVariant(VARIANT *dest, const FB::variant &var);
 };
 

\ No newline at end of file
+#endif // H_ACTIVEXBROWSERHOST
+
diff -r b893f12eb85c src/NpapiPlugin/NpapiBrowserHost.cpp
--- a/src/NpapiPlugin/NpapiBrowserHost.cpp	Mon May 10 14:15:18 2010 -0600
+++ b/src/NpapiPlugin/NpapiBrowserHost.cpp	Mon May 24 17:54:54 2010 +0300
@@ -78,6 +78,26 @@
     return FB::JSAPI_DOMWindow(m_htmlWin.ptr());
 }
 
+FB::variant NpapiBrowserHost::evaluateJavaScript(std::string script) {
+    NPVariant retVal;
+    NPVariant tmp;
+
+    this->getNPVariant(&tmp, FB::variant(script));
+
+    if (m_htmlWin.ptr() == NULL)
+        throw std::runtime_error("Cannot find HTML window");
+
+
+    if (this->Evaluate(m_htmlWin->getNPObject(),
+                       &tmp.value.stringValue, &retVal)) {
+        FB::variant ret = this->getVariant(&retVal);
+        this->ReleaseVariantValue(&retVal);
+        return ret;
+    } else {
+        throw script_error("Error executing JavaScript code");
+    }
+}
+
 FB::variant NpapiBrowserHost::getVariant(const NPVariant *npVar)
 {
     FB::variant retVal;
diff -r b893f12eb85c src/NpapiPlugin/NpapiBrowserHost.h
--- a/src/NpapiPlugin/NpapiBrowserHost.h	Mon May 10 14:15:18 2010 -0600
+++ b/src/NpapiPlugin/NpapiBrowserHost.h	Mon May 24 17:54:54 2010 +0300
@@ -44,6 +44,7 @@
     public:
         FB::JSAPI_DOMDocument getDOMDocument();
         FB::JSAPI_DOMWindow getDOMWindow();
