Javascript can close chrome tab through chrome extension
closeTabByJS Extension
Javacript can not close page in recent version chrome, because it's not safe. But we can close it with this extension installed.
warning: This extension can only work in http(s)://localhost or 127.0.0.1, to show some local demo.
\tfunction closeWindow () {
\t\tvar event = new Event('closeTabMessage');
\t\tdocument.body.dispatchEvent(event);
\t};
Run this function in javascript, you can close chrome tab now.
Source Manifest.json
Similar Extensions
Lock Tab 0 52 ★ 44.7KiB
Open pop-up as tab 0 9 ★ 12.69KiB
New Tabs at End 3000 0 21 ★ 22.59KiB
Extensity 0 1679 ★ 171KiB
Northstar Extension 0 1 ★ 5.36KiB
Don't Close Window With Last Tab 0 149 ★ 18.05KiB
Keep One Pinned Tab 0 57 ★ 17.5KiB
Close All Tabs 0 52 ★ 16.92KiB
Reopen closed tab Button™ 0 157 ★ 39.76KiB
JavaScript disable Chrome 0 10 ★ 95.44KiB
Keyboard Shortcuts to Close Other/Right Tabs 0 73 ★ 4.03KiB
Close Browser - Schedule the Shutdown of Your Tabs 0 1 ★ 59.57KiB
Tab Porter - Export & Restore Chrome Windows 0 21 ★ 804KiB
Duplicate Tab Closer 0 2 ★ 9.61KiB
Chrome Close Lock 0 82 ★ 459KiB
Multiple URL Opener 0 3 ★ 51.54KiB
Save Rendered HTML 0 3 ★ 164KiB
tab-killer 0 4 ★ 490KiB
Original New Tab 0 49 ★ 7.75KiB
Bulk URL Opener 0 10 ★ 16.61KiB
Duplicate Tab Closer 0 1 ★ 559KiB
All Tabs Closure 0 1 ★ 74.76KiB
Browser terminal 0 0 ★ 2.87MiB
Duplicate Tabs Closer (Monika [Peuj]) 0 0 ★ 1.03MiB