QtWebKit Application Cache: does it work?



  • I built a basic browser using QtWebKit and it works fine except for the application cache feature in HTML 5. Does anyone know if this is supported and works?

    That made me believe it wasn't supported even though it's advertised as supported. When I run the HTML 5 test found here http://html5test.com/ it shows that it does indeed support application cache. However whenever I try to use the JavaScript API to implement an application I can't get it to work. Also if I pull up a demo here: http://html5demos.com/offlineapp it basically does nothing.

    I can access the applicationCache object using: window.applicationCache in JS but I can't get it to read my manifest file or call the checking event. The same JavaScript works great in Chrome and Safari.

    This made me believe I implemented my browser wrong so I tried the demo browser packaged with both Qt 4.7 and Qt 4.8 BETA and had the same results. I then thought I could try the Arora browser as I read it was based on QtWebKit and I have the same result.

    This leads me to believe that although it's listed a supported feature and even though the HTML 5 test shows it's supported that somehow it's broken or I'm missing something to enable it inside my application or maybe it's really picky about my JS implementation.

    Anyone have any insight. Even a finger in the right direction would be helpful.

    Or if you've done something similar any examples would be helpful.

    Thank you!
    Nate



  • Ok, so I figured out the problem. I didn't enable offline web application cache. I assumed since it was supported it was enabled by default, but I guess I wasn't reading the documentation carefully enough that states it disabled by default... oops!

    So basically doing something like this enables it:

    @
    view = new QWebView(this);
    view->page()->settings()->enablePersistentStorage("put_you_path_to_local_storage_here");
    @

    And that did. After recompiling my app loaded all the way through perfect. I did notice that it doesn't seem to be calling the "progress" event on the event listener for window.applicatinoCache, but oh well, that's not so ciritical.

    Hope that helps someone... but then you're probably all better at reading the documentation ;).

    Nate


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.