Re: Shadowroot plugin to avoid CSS from HTML mails styling your UI

"Paul Lesniewski" <[email protected]> Fri, 7 Aug 2020 03:10:38 -0000
Newsgroups gmane.mail.squirrelmail.plugins
Message-ID <[email protected]>
Alexey,

>>> Under SquirrelMail 1.4.22, CSS styles in HTML mail might affect whole
>>> message window, usually making it look horrible:
>>>
>>> http://alexey.shpakovsky.ru/unlisted/shadowroot-before.png
>>>
>>
>> However, this is vastly different (mostly solved) in newer versions of
>> SquirrelMail.
>>
>>
>>> Provided plugin uses "shadowroot" feature of modern browsers, which
>>> with help of 6 lines of javascript confines CSS styles to content of
>>> message itself, making message look much better:
>>>
>>> http://alexey.shpakovsky.ru/unlisted/shadowroot-after.png
>>>
>>>
>>> Note that it requires enabled javascript and a fairly recent browser.
>>> Achieving similar effect without javascript would be possible by
>>> loading
>>>  contents of mail message within iframe, but that would be much bigger
>>> change :)
>>>
>>> Plugin is for SquirrelMail 1.4 only. Download link:
>>>
>>>
>>> http://alexey.shpakovsky.ru/unlisted/shadowroot.tar.gz
>>>
>>>
>>> Please let me know what you think.
>>>
>>
>> Thanks for your interest in trying to solve this problem.  I'd suggest
>> you test with version 1.4.23-svn or 1.5.2 and see if your email is
>> presented as expected since no JavaScript fix is necessary.
>>
>
> Thanks for the answer! Indeed, I see the issue is resolved in 1.5.2. Time
> to upgrade.

1.4.23-svn also has this fix.

> However, I see a room for improvement: with help of 2 or 3 lines of
> javascript it's possible to make iframe height equal to its contents, thus
> making scrolling and reading of long emails more pleasant. Do you think it
> worth making a plugin or adding to Squirrelmail core?

We'd be happy to take a look and see. Remember that JavaScript always has
to be optional in SquirrelMail.

-- 
Paul Lesniewski
SquirrelMail Team
Please support Open Source Software by donating to SquirrelMail!
http://squirrelmail.org/donate_paul_lesniewski.php




-----
squirrelmail-plugins mailing list
Posting guidelines: http://squirrelmail.org/postingguidelines
List address: [email protected]
List archives: http://news.gmane.org/gmane.mail.squirrelmail.plugins
List info (subscribe/unsubscribe/change options): https://lists.sourceforge.net/lists/listinfo/squirrelmail-plugins