Recent searches
No recent searches
Close all tabs function
Answered
Posted Feb 20, 2014
I often end up with a load of tabs open and although the Ctrl Alt W will close a tab it would be great to have a short cut to close all tabs
2
9
Recent searches
No recent searches
Posted Feb 20, 2014
I often end up with a load of tabs open and although the Ctrl Alt W will close a tab it would be great to have a short cut to close all tabs
2
9 comments
Andrew Schreiner
I ran into this and created a bookmarklet to do this. It will close all tabs that do not have changes
javascript:(function(){$('#branding_header ul li').each(function(){ if(!$(this).hasClass('activity')){$(this).find('.close').click();}});})();
0
Adam Payne
Worked a treat Andrew. I'd never used a bookmarklet till now so thank you. As I'm a noob to javascript would you mind explaining how the function works?
0
Marta
Hi, could anyone explain how to create this 'bookmarklet' please?
0
Marta
heres an explanation for anyone that's curious
Highlight the code then left click on it and slid your mouse up to your bookmark bar and drop it. Once you drag the code up there you can edit it to give it a easy name (i.e. Close ZD tabs). Then when you're within your ZD and have many tabs open simply click on the bookmark.
Works great, thanks Andrew!
0
Olaf Doemer
I like it, but it creates an empty tab like this one here that cannot be closed:
When I click the bookmarklet a second time, I get a two of these tabs. Reloading Zendesk gets rid of them.
I use Chrome Version 60.0.3112.101 (Official Build) (64-bit)
0
Jonathan Coleman
This should work in Chrome (probably any other modern browser too) and prevents the issue Olaf describes.
0
Andriy Ivakhov
Jonathan Coleman
thanks for your shortcut version. Could you please advise how do I add it? As I understood this should be a part of the url address?
0
Jonathan Coleman
@Andriy
You will need to install an extension which allows user scripts. For example Tampermonkey for Chrome. From the extension, add a new script and copy/paste in the code.
The shortcut key combo I assigned in the script is CTRL + SHIFT + Z.
0
Rich Hemmings
@Andrew - you just became my favorite person of the week. Please take two days off. Thank-You very much!! :D
0