Bug 89806 - How to get the javascript object(which bindings use the qt port ) caller frame
Summary: How to get the javascript object(which bindings use the qt port ) caller frame
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Qt (show other bugs)
Version: 528+ (Nightly build)
Hardware: All Linux
: P2 Critical
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-23 01:10 PDT by xiangpeng
Modified: 2022-07-29 10:47 PDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description xiangpeng 2012-06-23 01:10:03 PDT
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.
Comment 1 Alexey Proskuryakov 2022-07-29 10:47:12 PDT
The Qt port has been removed from WebKit, resolving.