Saturday, April 05, 2008

Demo browser update

As Thiago has recently blogged about the Qt 4.4 release candidate is now out. Since beta1 I have been spending a most my weekends hacking on the demo browser and there are many improvements in this release.

The first new feature is bookmarks. Using the same open standard format at Konqueror, I have two little classes that can read and write the XBel format. These class use the QXmlStreamReader and QXmlStreamWriter so they are super fast. Similarly to History there is a base bookmarks class and on top of it a model that is used in the menu, bookmarks dialog, add bookmark dialog, and in the bookmark toolbar. Lastly there is an import/export so you import Konqueror's bookmarks. I tried to choose a suitable set of simple default bookmarks. Getting bookmarks was a nice milestone. With my bookmarks in the demo I found myself using the application more and more.

The QLineEdit that contains the url got an upgrade. It is now its own class UrlLineEdit which is a subclass of another new class ExLineEdit. ExLineEdit was made to make it look like a QLineEdit with several widgets inside of it. For the url line edit I wanted to be able to put a widget on the left that displays that current url icon and has dnd support. The coolest feature of the UrlLineEdit has to be the progressbar like loading of the background (see the screenshot). When it doesn't have focus it will fill with a gradient to show the current page's loading progress. When the url scheme is https it will also have the background color be yellow. For those who are using the Oxygen style, note that there are some painting errors because QStyle::SE_LineEditContents is either not implemented or wrong (i.e. I haven't bothered to actually look into the Oxygen style's code, but all the other styles return the same rect inside the frame which cause me to suspect it has a bug).

Private Browsing
Safari has a mode called "Private Browsing". This mode essentially doesn't recorded history, icons, accept cookies or many other things. Some call it the porn mode and there are many similar extensions for Firefox. This feature is built into WebKit so QtWebKit has a matching attribute you can set. It was only an evening of hacking to add private browsing modes to the demo browser classes and now it too has this feature. Currently it is very safe, even maybe to the point of being too safe. When in this mode sites can neither set nor get cookies. Perhaps a temporary cookie jar should installed when in this mode.

A handful of new settings, including letting you specify the download location, what should happen when another application asks to open a link (new tab or new window), the ability to turn on/off javascript and plugins, proxy configuration, and the ability to set a user stylesheet (i.e. poor mans adblock).

Using the browser every day for the last few months in both OS X and Linux I found a handful of sites that didn't work for one reason or another. Most of them have been fixed. A few http issues, some Qt bugs, and issues in the QtWebKit port. With cookies set to always accept, GMail and Google's login is now working constantly for me. Getting better every day.

Overall application improvements
  • The ability to print and a print preview dialog

  • Added SaveAs Action

  • The Windows menu contains all of the top level windows.

  • Many more shortcuts

  • A default icon which is used everywhere that a site doesn't have an icon

  • Even faster startup!

  • Much more

Missing features
Rather then asking my friends what features they need the browser to have I ask them to try using it and then let me know the little things that drive them crazy. For me I discovered space key to page down and ctrl-up to move to the top of the page were killer features. Years of using those shortcuts were so ingrained that not having them was driving me nuts. I can surive without flash, but not those. So if you give the demo a whirl feel free to let me know what feature you use in your normal browser that you found missing.

Having an application that I use nearly everyday has been a lot of fun. QtWebKit is missing several things before this could turn into a browser I could use full time, most notably netscape plugins and disk cache, but already it has surpassed my expectations and brought joy to my weekend hacking.

Popular Posts