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

Gary Holmlund gary.holmlund at gmail.com
Sun Nov 13 22:17:30 MST 2011


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



More information about the bt-devel mailing list