Here is my thought, it may help giving you some ideas
I don't think the API support that. From the document, it only supports events related to Mark Selection, Filter, Parameter, Custom View, Tab switch...
Source: API Reference
There is an active request for that function:https://community.tableau.com/ideas/4043
2) In line with this, using popups might not work as browsers tend to block them. Any other trick?
With one of my project, I use Kendo UI Window component (it is commercial but you can just use jquey dialog with iframe support, it works the same way).
More here https://jqueryui.com/dialog/#default