Another elegant option is to add this as customized widget. Especially if you need the widget with custom events more often I would suggest to use this opportunity.
Go to Applications > Widgets and add a new widget.
Select then OpenUI5:
Select script to implement your extensions:
Enter the destination URL
Or link to existing content