Commit 28e2c179 authored by staikos's avatar staikos
Browse files

Add evaluateJavaScript() method


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@23546 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 996df135
...@@ -48,6 +48,8 @@ ...@@ -48,6 +48,8 @@
#include "bindings/runtime.h" #include "bindings/runtime.h"
#include "bindings/runtime_root.h" #include "bindings/runtime_root.h"
#include "kjs_proxy.h"
#include "kjs_binding.h"
#include "ExecState.h" #include "ExecState.h"
#include "object.h" #include "object.h"
...@@ -389,6 +391,19 @@ bool QWebFrame::focusNextPrevChild(bool next) ...@@ -389,6 +391,19 @@ bool QWebFrame::focusNextPrevChild(bool next)
return false; return false;
} }
QString QWebFrame::evaluateJavaScript(const QString& scriptSource)
{
KJSProxy *proxy = d->frame->scriptProxy();
QString rc;
if (proxy) {
KJS::JSValue *v = proxy->evaluate(String(), 0, scriptSource, d->frame->document());
if (v) {
rc = String(v->toString(proxy->interpreter()->globalExec()));
}
}
return rc;
}
/*!\reimp /*!\reimp
*/ */
void QWebFrame::scrollContentsBy(int dx, int dy) void QWebFrame::scrollContentsBy(int dx, int dy)
......
...@@ -56,6 +56,9 @@ public: ...@@ -56,6 +56,9 @@ public:
QList<QWebFrame*> childFrames() const; QList<QWebFrame*> childFrames() const;
public Q_SLOTS:
QString evaluateJavaScript(const QString& scriptSource);
signals: signals:
void cleared(); void cleared();
void loadDone(bool ok); void loadDone(bool ok);
......
2007-06-14 George Staikos <staikos@kde.org>
Reviewed by Lars.
Add evaluateJavaScript() method.
* Api/qwebframe.cpp:
(QWebFrame::evaluateJavaScript):
* Api/qwebframe.h:
2007-06-14 George Staikos <staikos@kde.org> 2007-06-14 George Staikos <staikos@kde.org>
Reviewed by Lars. Reviewed by Lars.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment