Close All Tabs Chrome Extension

14.08.2019

Close All Tabs Description: Moreover, you can allows this extension in incognito mode (see screenshot # 2 for help), it will also close the incognito windows and tabs.

I need close all tabs in Chrome window via my extension. What is the best practice now? How would you have done?

IvanIvan

2 Answers

In your background page, use chrome.tabs.query(..) to get all tabs, then call chrome.tabs.remove(..) to close that, code will look like:

Haibara AiHaibara Ai
8,2282 gold badges17 silver badges39 bronze badges

You can only close windows/tabs that you create yourself. That is, you cannot programmatically close a window/tab that the user creates.

Close all tabs shortcutChrome

For example, if you create a window with window.open() you can close it with window.close().

Mystery case files huntsville descargar

from https://stackoverflow.com/a/14373670/789377

Community
MaxaliMaxali
1,2992 gold badges13 silver badges23 bronze badges

Close All Tabs Firefox 3

Not the answer you're looking for? Browse other questions tagged javascriptgoogle-chromegoogle-chrome-extension or ask your own question.

Comments are closed.