How to Close Current Browser Window? [duplicate]





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







-2
















This question already has an answer here:




  • window.close and self.close do not close the window in Chrome

    12 answers




I would like to know how do I close the current browser window using javascript or any other language that enables this.



I have already seen the window.close () function but it does not work for my case because it only closes what was opened through window.open ().



I thank you for your help.





26/11/2018 - Coming back here to update



Many thanks for the beautiful help I had here and for the beautiful negative feedback in the question and for the markup as duplicated hahahaha (remembering that the similar questions are very old, which is not useful at the moment), without the beautiful help of the community I have developed a solution for what I needed :)










share|improve this question















marked as duplicate by Nick, jeroen php
Users with the  php badge can single-handedly close php questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 23 '18 at 12:21


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.



















  • You mean the current tab or the complete browser? (I think/hope this isn't possible via Javascript)

    – kerbholz
    Nov 23 '18 at 12:19













  • Yes, I even mention this in the question, I want to know if there is any way to do this, it does not necessarily have to be with javascript, it can be anything, just need the current window to be closed :(

    – Alisson Melo
    Nov 23 '18 at 12:30




















-2
















This question already has an answer here:




  • window.close and self.close do not close the window in Chrome

    12 answers




I would like to know how do I close the current browser window using javascript or any other language that enables this.



I have already seen the window.close () function but it does not work for my case because it only closes what was opened through window.open ().



I thank you for your help.





26/11/2018 - Coming back here to update



Many thanks for the beautiful help I had here and for the beautiful negative feedback in the question and for the markup as duplicated hahahaha (remembering that the similar questions are very old, which is not useful at the moment), without the beautiful help of the community I have developed a solution for what I needed :)










share|improve this question















marked as duplicate by Nick, jeroen php
Users with the  php badge can single-handedly close php questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 23 '18 at 12:21


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.



















  • You mean the current tab or the complete browser? (I think/hope this isn't possible via Javascript)

    – kerbholz
    Nov 23 '18 at 12:19













  • Yes, I even mention this in the question, I want to know if there is any way to do this, it does not necessarily have to be with javascript, it can be anything, just need the current window to be closed :(

    – Alisson Melo
    Nov 23 '18 at 12:30
















-2












-2








-2


0







This question already has an answer here:




  • window.close and self.close do not close the window in Chrome

    12 answers




I would like to know how do I close the current browser window using javascript or any other language that enables this.



I have already seen the window.close () function but it does not work for my case because it only closes what was opened through window.open ().



I thank you for your help.





26/11/2018 - Coming back here to update



Many thanks for the beautiful help I had here and for the beautiful negative feedback in the question and for the markup as duplicated hahahaha (remembering that the similar questions are very old, which is not useful at the moment), without the beautiful help of the community I have developed a solution for what I needed :)










share|improve this question

















This question already has an answer here:




  • window.close and self.close do not close the window in Chrome

    12 answers




I would like to know how do I close the current browser window using javascript or any other language that enables this.



I have already seen the window.close () function but it does not work for my case because it only closes what was opened through window.open ().



I thank you for your help.





26/11/2018 - Coming back here to update



Many thanks for the beautiful help I had here and for the beautiful negative feedback in the question and for the markup as duplicated hahahaha (remembering that the similar questions are very old, which is not useful at the moment), without the beautiful help of the community I have developed a solution for what I needed :)





This question already has an answer here:




  • window.close and self.close do not close the window in Chrome

    12 answers








javascript php jquery html ajax






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 26 '18 at 11:22







Alisson Melo

















asked Nov 23 '18 at 12:15









Alisson MeloAlisson Melo

13




13




marked as duplicate by Nick, jeroen php
Users with the  php badge can single-handedly close php questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 23 '18 at 12:21


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









marked as duplicate by Nick, jeroen php
Users with the  php badge can single-handedly close php questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 23 '18 at 12:21


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.















  • You mean the current tab or the complete browser? (I think/hope this isn't possible via Javascript)

    – kerbholz
    Nov 23 '18 at 12:19













  • Yes, I even mention this in the question, I want to know if there is any way to do this, it does not necessarily have to be with javascript, it can be anything, just need the current window to be closed :(

    – Alisson Melo
    Nov 23 '18 at 12:30





















  • You mean the current tab or the complete browser? (I think/hope this isn't possible via Javascript)

    – kerbholz
    Nov 23 '18 at 12:19













  • Yes, I even mention this in the question, I want to know if there is any way to do this, it does not necessarily have to be with javascript, it can be anything, just need the current window to be closed :(

    – Alisson Melo
    Nov 23 '18 at 12:30



















You mean the current tab or the complete browser? (I think/hope this isn't possible via Javascript)

– kerbholz
Nov 23 '18 at 12:19







You mean the current tab or the complete browser? (I think/hope this isn't possible via Javascript)

– kerbholz
Nov 23 '18 at 12:19















Yes, I even mention this in the question, I want to know if there is any way to do this, it does not necessarily have to be with javascript, it can be anything, just need the current window to be closed :(

– Alisson Melo
Nov 23 '18 at 12:30







Yes, I even mention this in the question, I want to know if there is any way to do this, it does not necessarily have to be with javascript, it can be anything, just need the current window to be closed :(

– Alisson Melo
Nov 23 '18 at 12:30














1 Answer
1






active

oldest

votes


















3














You cannot close a window with javascript that you did not open.
See https://stackoverflow.com/a/19768082/2623781 for more information.






share|improve this answer
























  • Yes, I know this, I even mention this in the question, I want to know if there is any way to do this, it does not necessarily have to be javascript, it can be anything, just need the current window to be closed :(

    – Alisson Melo
    Nov 23 '18 at 12:30




















1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









3














You cannot close a window with javascript that you did not open.
See https://stackoverflow.com/a/19768082/2623781 for more information.






share|improve this answer
























  • Yes, I know this, I even mention this in the question, I want to know if there is any way to do this, it does not necessarily have to be javascript, it can be anything, just need the current window to be closed :(

    – Alisson Melo
    Nov 23 '18 at 12:30


















3














You cannot close a window with javascript that you did not open.
See https://stackoverflow.com/a/19768082/2623781 for more information.






share|improve this answer
























  • Yes, I know this, I even mention this in the question, I want to know if there is any way to do this, it does not necessarily have to be javascript, it can be anything, just need the current window to be closed :(

    – Alisson Melo
    Nov 23 '18 at 12:30
















3












3








3







You cannot close a window with javascript that you did not open.
See https://stackoverflow.com/a/19768082/2623781 for more information.






share|improve this answer













You cannot close a window with javascript that you did not open.
See https://stackoverflow.com/a/19768082/2623781 for more information.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 23 '18 at 12:20









Monica AchaMonica Acha

428311




428311













  • Yes, I know this, I even mention this in the question, I want to know if there is any way to do this, it does not necessarily have to be javascript, it can be anything, just need the current window to be closed :(

    – Alisson Melo
    Nov 23 '18 at 12:30





















  • Yes, I know this, I even mention this in the question, I want to know if there is any way to do this, it does not necessarily have to be javascript, it can be anything, just need the current window to be closed :(

    – Alisson Melo
    Nov 23 '18 at 12:30



















Yes, I know this, I even mention this in the question, I want to know if there is any way to do this, it does not necessarily have to be javascript, it can be anything, just need the current window to be closed :(

– Alisson Melo
Nov 23 '18 at 12:30







Yes, I know this, I even mention this in the question, I want to know if there is any way to do this, it does not necessarily have to be javascript, it can be anything, just need the current window to be closed :(

– Alisson Melo
Nov 23 '18 at 12:30







Popular posts from this blog

Paul Cézanne

UIScrollView CustomStickyHeader Resize height generates problems when scroll is too fast

Angular material date-picker (MatDatepicker) auto completes the date on focus out