FireBreath  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Pages
void ActiveXBrowserHost::evaluateJavaScript ( const std::string &  script)
virtual

Evaluates arbitrary javascript; note that it does not return the result due to cross- browser compatibility issues.

Parameters
scriptThe script to evaluate.

Implements FB::BrowserHost.

Definition at line 119 of file ActiveXBrowserHost.cpp.

120 {
121  if(!m_htmlWin) {
122  throw FB::script_error("Can't execute JavaScript: Window is NULL");
123  }
124 
125  CComVariant res;
126  HRESULT hr = m_htmlWin->execScript(CComBSTR(script.c_str()),
127  CComBSTR("javascript"), &res);
128  if (SUCCEEDED(hr)) {
129  /* Throw away returned VARIANT, this method always returns VT_EMPTY.
130  http://msdn.microsoft.com/en-us/library/aa741364(VS.85).aspx */
131  return;
132  } else {
133  throw FB::script_error("Error executing JavaScript code");
134  }
135 }
Exception type; when thrown in a JSAPI method, a javascript exception will be thrown.
Definition: JSExceptions.h:28