How do I close the current browser tab? The following aren't working.
JavaScript.getCurrent().execute("window.close();");
or
UI.getCurrent().removeWindow(window);
or
window.close();
Try this:
Window appointmentWindow = getApplication().getWindow(NATIVE_WINDOW_NAME);
if (appointmentWindow != null) {
getApplication().removeWindow(appointmentWindow);
}
Iren Patel
Try this.
gBrowser.removeCurrentTab();
来源:https://stackoverflow.com/questions/17759411/how-to-close-current-browser-tab