[bt-devel] Problem with Mag window not working is fixed.

Martin Gruner mg.pub at gmx.net
Mon Nov 14 00:40:36 MST 2011

Hi Gary,

very cool!
AFAIR, we currently require Qt 4.5, where such a "proxy" class is needed
to create a bridge between C++ and JS. With Qt 4.6, this is not required
any more. So if we decide to up the version, the code could be changed
and simplified.

Regards, mg

Am 14.11.11 06:17, schrieb Gary Holmlund:
> I fixed the problem with the Mag window not working with newer
> versions of Qt (Qt 4.7.4 + QtWebKit 2.2 or later). The current version
> shipping with Ubuntu 11.10 and Fedora 16 is broken because of this
> issue. I know that we will soon release 2.9,  but Ubuntu has been
> reluctant to upgrade to feature releases. I am wondering if we should
> create a 2.8.3 for this fix.
> Bug details
> Each BibleTime window uses Qt WebKit classes to display the page. We
> use javascript on the page to associate the mouse coordinates with DOM
> elements and display the corresponding entry in the Mag window. The
> javascript also handles drag/drop and a few other things.
> There is a c++ class (BtHtmlJsObject) that is associated with the
> javascript on a page in BibleTime. This class allows c++ to call
> javascript and javascript to call c++. With the latest versions of Qt
> both the class instance and the javascript have a "security origin".
> The first time the class instance is associated with the javascript
> everything is ok. But when the next page with javascript is loaded
> into the window and associated with the same class instance, they have
> different security origins. WebKit is checking this and throwing an
> cross site scripting error. The javascript does not run correctly.
> It took a lot of debugging down into Qt to figure this out. Once I
> knew the issue I suspected I could fix it by associating a new class
> instance with the javascript each time the page is reloaded. This
> fixed the problem.
> Gary
> _______________________________________________
> bt-devel mailing list
> bt-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/bt-devel

More information about the bt-devel mailing list