简体   繁体   English

是否可以使用 java/spring boot 关闭浏览器的当前选项卡

[英]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 .我的要求是使用 java/Spring boot 关闭当前选项卡。 is there any way to do this with java.有没有办法用java来做到这一点。 if not .如果不 。 then can we use other language in java to achieve this functionality.那么我们可以在java中使用其他语言来实现这个功能吗?

The Window.窗户。 close() method closes the current window, or the window on which it was called. close() 方法关闭当前窗口或调用它的窗口。 This method can only be called on windows that were opened by a script using the Window.此方法只能在使用 Window 的脚本打开的窗口上调用。 open() method.打开()方法。

Since Java is a back-end language, it cannot be used to close current windows.由于 Java 是一种后端语言,因此不能用于关闭当前窗口。

Instead, use:相反,使用:

close();

Which is the equivalent of:这相当于:

window.close();

(It assumes the current tab) (它假定当前选项卡)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM