I have decided (again) that web development can be a huge time waster. So much time is wasted chasing your tail on difficult to reproduce bugs or on bugs which are hard to debug. It gets quickly frustrating.
I had two ‘biggies’ on my schedule for today.
The first was a very simple report: "When I load the rich text editor and then hit ‘back’ in my browser, IE 6 crashes".
That’s the kind of bug which will either be fixed in a few seconds, or will take forever. Unfortunately for me, it was the latter. Firstly, I googled on ‘ie6 crash wysiwyg’ which brought up a few interesting links about a recent security update. I fired up my PC laptop and attempted to recreate the problem but couldn’t.
I ran Windows Update and when the PC restarted, I was able to recreate the problem every single time. A few wild goosechases on security reports went nowhere. I started commenting out blocks of code in the rich text editor to try and narrow the problem down and eventually traced it to the rather innocent looking rtewindow.document.designMode = "on". Remove that and there is no crash when you hit ‘back’ but also there is no working RTE. I did a bit of fiddling and noticed that document.contentEditable = true; didn’t suffer from this problem. Unfortunately it would mean rewriting a large portion of the IE/RTE code. Something that I didn’t want to do.
Armed with the cause of the problem, I did some more google research and found an interesting article on IE6 and DOCTYPES; especially when loading different pages into iframes.
Getting a bit warmer now. I had another look at the HTML it produces and found the culprit. A single blank HTML file which is loaded into the RTE to prime the colour picker had a dodgy DOCTYPE. I fixed that and the crash was gone!
The second bug was a little more complex. Mozilla (Firefox, etc) fails to honour the "meta" redirect now and again. Google came through again with a link to a Mozilla bug which found the problem to be with the gecko engine and nothing to do with IPB. When ‘midas’ is loaded, subsequent meta-redirects fail.
I decided to add a bit of javascript to the redirect page to force a setTimeout function if the user is using an affected version of gecko browser.
The moral of the story? Google is the best way to fix bugs.
{ 8 comments… read them below or add one }
Yes it is. That is how I fix a lot of bugs when I make things
Vive la Google!
Although they’re bound to take over the world one day, those Googlers are quite handy.
I truely believe Google will one day solve world hunger.
World Hunger? Lol maybe.. maybe there will be a site on google with the solution!
I love google
Out of interest, why would you ever need a page with a midas editor _and_ a meta redirect on it?
Arrrgh! It’s showing my email address!! ^^^^^^^
Peter,
I don’t. The problem is that when a browser window or tab has had a midas editor loaded in it, subsequent meta redirects will fail until you close the window or tab. For instance, you click “Edit” and edit the post. Hit “Submit” and the page that says “Thanks, your post has been edited” doesn’t refresh, it just stays there. This window is now ‘tainted’ and all meta redirects are ignored.
It’s been fixed in the nightlies but it’ll be a while before a milestone is released and the world upgrades to it.
Google is the best search engine ever.