简体   繁体   中英

Closing Firefox Window or current Tab Using Java Script

How can i close a Firefox Window or current Tab Using Java Script? I tried the following code, but it doesn't work....

window.close();

Please anyone help me!!!!

in JS, basically:

window.close();

or

self.close();

for more information, take a look at this and this .

You only can close windows you have opened yourself and in most browsers the user will be prompted and ask for permisson, at least if the window has already a history.

var myWindow= window.open(address, "title", "width=300,height=400,left=100,top=200");
myWindow.close();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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