When the user goes to close the web page, clicking on the "x" of the tab (which has the favicom) in the browser, does a popup open?

You can simply have a transparent strip in your header at the top which is setup with a onMouseIn function so that when the user moves mouse into that strip area, then the lightbox will pop up.

Code for one time show lightbox.
https://support.wix.com/en/article/corvid-tutorial-creating-a-one-time-popup

Or you can simply look at using variuos exit intent apps from Wix.
https://www.wix.com/app-market/visitor-hook/overview

You can also vote for it here too.
https://support.wix.com/en/article/request-triggering-a-lightbox-when-a-visitor-attempts-to-leave-your-site