Close a window/ tab with script?

Good day, I don’t know how to write the code to close the current Wix (editor X)tab (not lightbox), please help if possible.

The closes thing i can think of is :
$w . onReady ( function () {
$w ( ‘#text3’ ). onClick ( () => {
window . close ()
})
});

No working, of course.

Background:
I am creating a site that needs to jump between two sites.
One is Wix and is another.
The other site can only open the wix site via new window/tab.
And i need the user to be able to “jump back” to the OG tab which he/she opens the wix site from.
I don’t want them to open another new page to get back to the OG tab. So i want to add a function to a text item to close the current tab, which gets them back to the OG tab without opening the pages again and again.

I know i am making things sounds complicated, but all i need is a way to "click on a text item (#text1, for example) and close the current tab (which is “the first in that window/tab’s session history”)

Thank you!