 \ 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 @@
+diff -r 5def419d742e src/NpapiPlugin/NpapiBrowserHost.cpp
+--- a/src/NpapiPlugin/NpapiBrowserHost.cpp	Fri Jun 25 15:32:34 2010 +0300
++++ b/src/NpapiPlugin/NpapiBrowserHost.cpp	Mon Jun 28 15:28:32 2010 +0300
+@@ -78,6 +78,28 @@
      return FB::JSAPI_DOMWindow(m_htmlWin.ptr());
  }
  
-+FB::variant NpapiBrowserHost::evaluateJavaScript(std::string script) {
++void NpapiBrowserHost::evaluateJavaScript(const std::string &script)
++{
 +    NPVariant retVal;
 +    NPVariant tmp;
 +

+
+    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");
+    }

+    HRESULT hr = m_htmlWin->execScript(CComBSTR(script.c_str()),
+                                       CComBSTR("javascript"), &res);
+    if (SUCCEEDED(hr)) {
+        /* Throw away returned VARIANT, this method always returns VT_EMPTY.
+           http://msdn.microsoft.com/en-us/library/aa741364(VS.85).aspx */
+        return;
+    } else {
+        throw FB::script_error("Error executing JavaScript code");
+    }
+}
+
 FB::variant ActiveXBrowserHost::getVariant(const VARIANT *cVar)
 {
     CComVariant converted;
@@ -217,4 +236,4 @@
         delete stream;
         return 0;
     }
-}
\ No newline at end of file
+}
diff -r 5def419d742e src/ActiveXPlugin/ActiveXBrowserHost.h
--- a/src/ActiveXPlugin/ActiveXBrowserHost.h	Fri Jun 25 15:32:34 2010 +0300
+++ b/src/ActiveXPlugin/ActiveXBrowserHost.h	Mon Jun 28 15:28:32 2010 +0300
@@ -40,6 +40,7 @@
 public:
     FB::JSAPI_DOMDocument getDOMDocument();
     FB::JSAPI_DOMWindow getDOMWindow();
+    void evaluateJavaScript(const std::string &script);
 
 protected:
     HWND m_hWnd;
