/    Sign up×
Community /Pin to ProfileBookmark

close current tab in a browser window using JavaScript

Do you know How to close current tab in a browser window using JavaScript?

to post a comment
JavaScript

6 Comments(s)

Copy linkTweet thisAlerts:
@cootheadJan 18.2020 — Hi there @mikehesson,

I don't believe that it is possible.

To the best of my knowledge, it is only possible

to **close** windows with javascript that have been

**opened** with javascript.

_coothead_
Copy linkTweet thisAlerts:
@VITSUSAJan 21.2020 — @mikehesson#1613310 Click on the mentioned hyperlinks to know more about how to close current tab in a browser window using JavaScript -

https://www.codespeedy.com/close-current-tab-in-browser-window-using-javascript/

https://www.geeksforgeeks.org/how-to-close-current-tab-in-a-browser-window-using-javascript/
Copy linkTweet thisAlerts:
@mikehessonauthorJan 23.2020 — @coothead#1613316 @VITSUSA#1613395 I just Read here how to do that

https://ci3school.com/how-to-close-current-tab-in-a-browser-window-using-javascript/
Copy linkTweet thisAlerts:
@cootheadJan 23.2020 — Hi there mikehesson.

the site to which you linked has this statement...

[color=#069]
>_"A current tab or window can only be closed if it was created by that script.

>That means the window.close() function is only allowed for the window or

>tab that has been created and opened using the window.open() method."_


[/color]


This is exactly what I pointed out to you in my post **five days ago**. :)

_coothead_
Copy linkTweet thisAlerts:
@mikehessonauthorJan 30.2020 — ahh Thanks
Copy linkTweet thisAlerts:
@fabian1995Feb 04.2020 — https://www.ondernemers-nederland.nl/
×

Success!

Help @mikehesson spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.25,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...