Changeset 23546 in webkit


Ignore:
Timestamp:
Jun 14, 2007 7:51:14 PM (17 years ago)
Author:
staikos
Message:

Add evaluateJavaScript() method

Location:
trunk/WebKitQt
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitQt/Api/qwebframe.cpp

    r23545 r23546  
    4949#include "bindings/runtime.h"
    5050#include "bindings/runtime_root.h"
     51#include "kjs_proxy.h"
     52#include "kjs_binding.h"
    5153#include "ExecState.h"
    5254#include "object.h"
     
    390392}
    391393
     394QString QWebFrame::evaluateJavaScript(const QString& scriptSource)
     395{
     396    KJSProxy *proxy = d->frame->scriptProxy();
     397    QString rc;
     398    if (proxy) {
     399        KJS::JSValue *v = proxy->evaluate(String(), 0, scriptSource, d->frame->document());
     400        if (v) {
     401            rc = String(v->toString(proxy->interpreter()->globalExec()));
     402        }
     403    }
     404    return rc;
     405}
     406
    392407/*!\reimp
    393408*/
  • trunk/WebKitQt/Api/qwebframe.h

    r23545 r23546  
    5757    QList<QWebFrame*> childFrames() const;
    5858
     59public Q_SLOTS:
     60    QString evaluateJavaScript(const QString& scriptSource);
     61
    5962signals:
    6063    void cleared();
  • trunk/WebKitQt/ChangeLog

    r23545 r23546  
     12007-06-14  George Staikos  <staikos@kde.org>
     2
     3        Reviewed by Lars.
     4
     5        Add evaluateJavaScript() method.
     6
     7        * Api/qwebframe.cpp:
     8        (QWebFrame::evaluateJavaScript):
     9        * Api/qwebframe.h:
     10
    1112007-06-14  George Staikos  <staikos@kde.org>
    212
Note: See TracChangeset for help on using the changeset viewer.