Skip navigation.
KDE Developer's Journals

Yet another GMail fix

carewolf's picture

As some might have noticed GMail was updated this morning. As usual this broke the standard view Konqueror, but only if you use the recommended method of spoofing as Firefox.

Fortunately I traced it down and fixed it in no time at all Laughing out loud

Here is the patch for your convenience (apply in kdelibs/khtml):

--- /home/carewolf/html_elementimpl.cpp 2007-05-18 10:48:33.000000000 +0200
+++ html/html_elementimpl.cpp   2007-05-18 10:50:36.000000000 +0200
@@ -562,6 +562,13 @@

void HTMLElementImpl::setInnerHTML( const DOMString &html, int &exceptioncode )
{
+    // Works line innerText in Gecko
+    // ### test if needed for ID_SCRIPT as well.
+    if ( id() == ID_STYLE ) {
+        setInnerText(html, exceptioncode);
+        return;
+    }
+
     DocumentFragment fragment = createContextualFragment( html );
     if ( fragment.isNull() ) {
         exceptioncode = DOMException::NO_MODIFICATION_ALLOWED_ERR;

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
kamruddin.nur's picture

How do I apply this patch to Konqueror 3.5

I can only access to gmail in html view. Standard view doesn't work at all, neither with IE browser identification nor with firefox browser identification. I wanna try this patch but how to apply this patch? Please provide a detailed instruction. I'm using fc8 with KDE 3.5.8-7.fc8

carlo's picture

Hi Allen, care to explain

Hi Allen, care to explain why you're posting the fix, but not committing it? Any problems with it!?

vdboor's picture

Curious...

Cool to see such patch.

Have two questions though:
- what JavaScript line causes this problem?
- And are these kind of necessary hacks documented somewhere? For example, the fact window.frames[ id ] returns any DOM element in MSIE, or location = location.href also works. Sticking out tongue

carewolf's picture

Answer

These lines are responsible:

    if(BU)
        {c.cssText=b}
    else if(B9)
        {c.innerText=b}
    else
        {c.innerHTML=b}

Where BU is set on MSIE UserAgent, and B9 set on Safari UserAgent.

So the short answers is that stuff like this happens because GMail is horrible piece of crappy enginering.

The correct way to do this would have been to test for the properties cssText or innerText on StyleElements, and only use the innerHTML gecko-hack if anything sane fails. Unfortunately the JS-idiots at Google are incapable of using anything other than UserAgent switches.

superstoned's picture

3.5.7

is this going to make it in KDE 3.5.7? I know it's tagged, but this sounds like it's worth it...

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.