Trigger javascript alert popup message from python?

Hi all,
I’m looking for a way to send a popup message from a pre- or post-save hook (python) back to the UI.

I’ve seen a few third-party ‘messagebox’ solutions but wanted to do things "the right way"™ using custom.js, but the examples I’ve seen are all bound to a toolbar widget or something in the UI – is it possible to call a “dialog.modal” javascript from python code? Any tips, examples, links, etc. appreciated.

TIA,
John