0

I need to close firefox's current tab, either by javascript or any other method, if possible.

I had found somewhere the following solutions:

window.close();

and

 var myWin = window.open('','_self','');
  myWin.close();

and both the codes are working in:

  1. Chrome 56.0
  2. Opera 44.0
  3. Internet Explorer 11
  4. Microsoft Edge 38
  5. Safari 5.1

But not in Firefox, I want this working in Firefox.

I have Firefox 52.0, Please Suggest any method,...

Thankyou

1 Answers1

0

Try this

window.open(document.URL,'_self','resizable=no,top=-245,width=250,height=250,scrollbars=no');
window.close();

This should work on chrome and firefox, collected from Close firefox tab from javascript

Community
  • 1
  • 1
azs06
  • 3,467
  • 2
  • 21
  • 26