I'm trying to make the current window close with some kind of java script function. But I have not managed to achieve it. I have already used some methods but apparently they do not work unless the window is opened by means of a similar function, something that is irrelevant.
function Finalizar() {
var ventana = window.self;
ventana.opener = window.self;
ventana.close();
}
function Finalizar() {
parent.window.close();
}
function Finalizar() {
setTimeout("self.close();", 7000);
}
<button type="button" class="btn btn-primary" onClick="self.close();">Entendido</button>
<button type="button" class="btn btn-primary" onclick="javascript:self.close()" >Entendido</button>
This is the message I get from debugging the browser
Scripts may close only the windows that were opened by it.
Any information to help the problem?