Skip to content

is it possible to close current tab of browser using java/spring boot

my requirement is to close the current tab using java/Spring boot . is there any way to do this with java. if not . then can we use other language in java to achieve this functionality.

Answer

The Window. close() method closes the current window, or the window on which it was called. This method can only be called on windows that were opened by a script using the Window. open() method.

Since Java is a back-end language, it cannot be used to close current windows.

Instead, use:

close();

Which is the equivalent of:

window.close();

(It assumes the current tab)