Firefox using window.close()

  1. Go to address bar and type about:config
  2. Go to parameter dom.allow_scripts_to_close_windows
  3. Set its value as true

javascript - How do I close a firefox tab from a greasemonkey script? - Stack Overflow