-1

I am trying to get my tab to close at the end of a method call. I used window.close(). But it isnt working and I am getting a triangular yellow exclamation mark in the debugger with message that says "Scripts may close only the windows that were opened by it".

Can someone tell me how I can close any tab? Thanks.

Im using Chrome but I need it to work on all browsers.

discodowney
  • 1,475
  • 6
  • 28
  • 58

1 Answers1

0

The error tells you exactly what you're asking. Javascript can only window.close() windows that it had created using window.open()

Source: https://developer.mozilla.org/en-US/docs/Web/API/Window/close

blastitall
  • 62
  • 7