How to close a lightbox from javascript

This used to work:

top.lp.jQuery.ubpoverlay.close();

Suddenly it stopped working. Have also tried this:

javascript:lp.jQuery.ubpoverlay.close()

from here: https://gist.github.com/johnnyopao/54790aef1f81eb68a03a

which also doesn’t work.

I want to programatically close the lightbox which a page is showing on (from that page (which is embedded as an iframe)). The user gets to that lightbox content after clicking a CTA button which specified that a page should be opened in a lightbox.

For anyone else, I solved it with this:

top.lp.jQuery('button[type=button][role=button]').click()

hacky but works.