Version: (using KDE Devel) Installed from: Compiled sources Compiler: gcc (GCC) 3.4.4 (Gentoo 3.4.4, ssp-3.4.4-1.0, pie-8.7.8) OS: Linux I've downloaded Adblock v6 from [1], patched KDE 3.4.1, recompiled and installed everything. Adblocking in konqueror works just fine, but I have a problem with kmail. Kmail needs about ten seconds to open some of my mails, kmail is unresponsive at this time and cpu usage is at 100%. That mails are non html and I don't know what triggers the problem. Any ideas? Installing kdelibs without the patch solves the problem, but konqueror can't block urls any longer. [1] http://lists.kde.org/?l=kfm-devel&m=111533835616299&w=2
Created attachment 11616 [details] this email is one of the mails having the problem
There's no html in that example message.
You're right, there's no thml in the example message. Nevertheless, I see the described behaviour with this message.
KMail uses KHTML in all cases, even for non-HTML messages. It generates HTML from the plain text mail, for rendering purposes.
Ah, completely misread original post as saying non-html mails do not have the problem. That sample opens instantly for me with AdBlock enabled. If you simply disable filtering is it still slow to open that mail for you?
No, disabled filtering solves the problem as well.
OK please attach your adblock filter list, or alternatively try to systematically reduce your filter list to determine if a specific filter is causing problems.
Seems to be a proportional relation: The more url expressions I add the longer kmail hangs.
OK please supply some details of your filter list. I have about 150 filters in my list and I don't see any noticeable slowdown with that mail message at all... and certainly not 10 seconds.
Created attachment 11635 [details] my adblock list This is my adblock list that makes kmail hang for some seconds on some mails. Reducing the list to the only entry "*/ads/*" kmail still hangs for half a seconds (it's not long, but still noticable, especially when you click through the mails with "Go to next unread message") on these mail.
Ok, isAdFiltered is getting passed a 2k "data:image/png;base64..." url from the HTMLTokenizer when that message is opened, combined with your filter set that kills QRegExpEngine. I'll add a url sanity check. Thanks.
Ah, great news. ;) Can you please post a link to the patch? Thanks.
Commit: http://lists.kde.org/?l=kde-commits&m=112025064627923&w=2
Or, more easily: http://websvn.kde.org/trunk/KDE/kdelibs/khtml/khtml_settings.cc?p2=%2Ftrunk%2FKDE%2Fkdelibs%2Fkhtml%2Fkhtml_settings.cc&p1=trunk%2FKDE%2Fkdelibs%2Fkhtml%2Fkhtml_settings.cc&r1=430579&r2=430578&rev=430579&view=diff&makepatch=1&diff_format=u
Fantastic, this also fixes a bug which I have experienced with amaroK since we started using data: urls in the context browser. Thanks for the quick fix, ivor :-)