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.

Bookmarks
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.

ExLineEdit
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.

Settings
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).

QtWebKit
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.

11 comments:

liquidat said...

Sounds nice - any chance that "normal" people will be able to give it a test anytime soon?

Or would you allow me to write a review about it? I would love to have a stand-alone browser based on WebKit on my KDE :)

Btw., one feature I would like to see in any new browser: the ability to plug-in password storages. I would like to use the wallet I prefer (Gnome wallet, kwallet, whatever).

nareshov said...

OMG! standalone proxy configuration instead of pulling it from KControl's :O

Please tell me where I can pull the source from :)

How about integrating a del.icio.us bookmarking backend by default? This browser could possibly be the first to do that!
http://websvn.kde.org/trunk/playground/pim/del.icio.us/

Benjamin Meyer said...

@liquidat Building Qt is pretty painless, but at some point in the future it would be cool to put up a little website with linux/mac/windows binaries for download. I think one of kununtu devs even has some qt4-demos package that you can install, but not sure about that. If you do review it remember that this is a small project with much todo still so comparing it to firefox or safari as it is today would be unfair. As for wallet I agree and have it down as one of the first extensions I want to write when I merge in my QScript/Extensions branch.

@nareshov: It would actually be nice if Qt automatically pulled the proxy configuration from KControl I would think. The source is inside of the qt release in the demos directory.

liquidat said...

Building Qt is pretty painless, but at some point in the future it would be cool to put up a little website with linux/mac/windows binaries for download. I think one of kununtu devs even has some qt4-demos package that you can install, but not sure about that.
Well, Qt shouldn't be the problem, I was more wondering about your browser. Where can I get the sources from? Are they already released?!

If you do review it remember that this is a small project with much todo still so comparing it to firefox or safari as it is today would be unfair.
Don't worry, a review of something in early development is not supposed to be a comparison but to show which road it might take and what i can already do in such an early development state.
And I would be pretty clear about that to avoid any trolls to post stuff like "but it can't do xy while Firefox can do" :)

As for wallet I agree and have it down as one of the first extensions I want to write when I merge in my QScript/Extensions branch.
Perfect! There is no browser I know of which has a pluggable wallet system, although it could really help. I wouldn't want to input all my data again which are already stored with Konqueror.

Henning Schröder said...

It would be great if you could add a simple QLibrary-based plug-in system. Then the user could choose between alternative bookmark implementations like one for del.ici.ous.
I would be interested in contributing a Python plug-in to extend the browser with PyQt.

liquidat said...

Now I got it - the demo browser is already part of Qt 4.4. I thought it was an independent project. Sorry for the confusion...

Mauro Iazzi said...

I tried it and found it very good. I have some things I'd like to see changed:
- shortcuts should be configurable. I find Next/Previous tab painful since I don't have {} on my keyboard.
- I'd like to choose the engine for the web search (I use wikipedia, usually)
- I'd like to configure an automatic search engine when I input many words on the URL line
- the find dialog can get in the way of the word it finds. It would be great if it popped up from the bottom.
- some or all of the above could be achieved by making something scriptable...

P.S. I'm writing this from your browser. It is really really good already

blake812 said...

How can I get a copy of this browser ?

anshu said...

I am not able to login in gmail. It is giving following error
Unknown protocol specified

When connecting to: https://www.google.com/accounts/ServiceLogin?service=mail&passive=true&rm=false&continue=http://mail.google.com/mail/?ui=html&zy=l&bsv=1k96igf4806cy&ltmpl=default&ltmplcache=2.

Check the address for errors such as ww.trolltech.com instead of www.trolltech.com
If the address is correct, try to check the network connection.
If your computer or network is protected by a firewall or proxy, make sure that the browser demo is permitted to access the network.

Could you help me with this?

joove said...

On a grep through the source code, I see that "https" is reduced to an unsupported protocol if the code is compiled with QT_NO_OPENSSL.

QT_NO_OPENSSL results if you compile QT without having ssl include files around in standard locations.

make sure you have libssl-dev package (on ubuntu). The configure script passess if it finds openssl under /include, /usr/include or /usr/local/include. Look under conf.tests/unix/openssl.

anshu said...

Thanks a lot. It worked. I reconfigured qt with openssl option enabled and it worked.
But now i have found a bug. If you add folders to bookmarks then whole bookmark menu gets messed up. I am still trying to figure out the bug. If somebody knows about it do let me know.

Popular Posts