[Webkit-unassigned] [Bug 89806] New: How to get the javascript object(which bindings use the qt port ) caller frame

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Jun 23 01:10:07 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=89806

           Summary: How to get the javascript object(which bindings use
                    the qt port ) caller frame
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: All
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: Critical
          Priority: P2
         Component: WebKit Qt
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: imxiangpeng at gmail.com


Hi, all!

In qt we can use the following two functions add our self custom object to javascript world.

void QWebFrame::addToJavaScriptWindowObject ( const QString & name, QObject * object, QScriptEngine::ValueOwnership own )
QVariant QWebFrame::evaluateJavaScript ( const QString & scriptSource )

simple  code :

class MyClass{

public :
    MyClass();
    ~MyClass();
public slots:
    void jsInterface();

};
MyClass *myObj = new MyClass;
web_frame1->addToJavaScriptWindowObject("myJsObj", myObj);

web_frame2->addToJavaScriptWindowObject("myJsObj", myObj);

we can call myJsObj.jsInterface() in both web_frame1 and web_frame2 , but I can not identify which frame (is web_frame1 or web_frame2 ?)is calling the myJsObject object.

I think we should get the js env world in MyClass , but it seems that there's no interface to get the purpose.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list