Sitecore Core Development

Friday, July 22, 2005

Firefox

Ahhh, Firefox. I really like Firefox and use it as my everyday browser. This has nothing to do with Microsoft or security issues - I just like it better than Internet Explorer as it feels more lightweight.

So I was quite exicited to make the Sitecore 5.x client compatible with Firefox.

We tried to make the 4.x client compatible, but ran into a showstopper. The problem was the ShowModalDialog DHTML javascript function. The ShowModalDialog function shows an HTML page in a modal window, and halts the javascript execution until the window is closed by the user. This makes it quite useful for getting responses from the user like selecting a Master or showing a wizard.

Firefox (and Mozilla browsers) does not support this function and in 4.x we simply could not change the architecture in a way that would accommodate this lacking feature. This is the reason why Firefox support was dropped from the 4.x client.

As I was designing the 5.x client, I kept this problem in mind. The SheerUI architecture sends a number of commands to the client which is handled by a javascript intepreter and one of these commands is ShowModalDialog. I designed the intepreter in such a way that it is able to halt after a command and resume at a later time. This make it possible to halt the javascript after a ShowModalDialog command.

So when a ShowModalDialog command is executed by the intepreter, it simply opens a new window using window.open(), puts the state of execution on a stack and halts. When the opened window closes, a javascript function checks if the window was part of a execution, and if it was, it resumes the execution.

This simulates the ShowModalDialog function quite well.

I really, really hope that the Firefox community will implement this very useful feature soon, it is sorely missed!

0 Comments:

Post a Comment

<< Home