How to start creating a plugin

Hi,

what is the best approach to start creating a web app plugin. My goal i to analyze headers to gather informations about Ciphermail actions and encryption state of incoming mails and display icons to reflect these and perhaps display a popup with detailed informations as I did for Thunderbird: https://wiki.mhcsoftware.de/ciphermail_thunderbird_addon

TIA
Matthias