Your code is running isolated so you cant access the DOM or the normal window scope.
I dont think you can do it if you use UI kit, but I have a feeling you can use a blob URL combined with custom UI and the forge bridge open(url) from New custom UI methods, Jira project page module, and scopes for product events