-1

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 :)

Alisson Melo
  • 11
  • 1
  • 4
  • You mean the current tab or the complete browser? (I think/hope this isn't possible via Javascript) – brombeer 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
  • @AlissonMelo it would be great if you could share with us your solution, even though no one else came up with it. thanks – adutra May 22 '19 at 18:31

1 Answers1

3

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

Monica Acha
  • 1,076
  • 9
  • 16
  • 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