ProgressUI Browser Integration v1.0
ProgressUI Browser Integration will send information about downloads (from download manager) to session daemon, which stores information about task (in this case - download progress and state). You also need a special UI (currently there exist only written in Libgreattao) to monitor task state and select events to be called, when task have special state.
Source code are here: https://sourceforge.net/projects/progresui/ . You need to compile daemon, ui and program allowing to communicate browser with daemon. The last part is to install communication program in /usr/local/bin.