Skip to content

Instantly share code, notes, and snippets.

@jondcoleman
Last active April 8, 2020 20:32
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save jondcoleman/3a171848e1ec6a902b7798af4b6b5c3d to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Close Inactive ZD tabs with CTRL+SHIFT+Z
// @match https://*.zendesk.com/*
// ==/UserScript==
(function() {
'use strict'
document.body.addEventListener('keyup', e => {
if (e.shiftKey && e.ctrlKey && e.key === 'Z') {
const closeButtons = [...document.querySelectorAll('div[role="tab"][data-selected="false"] button[aria-label="Close"]')]
closeButtons.forEach(btn => btn.click())
}
})
})()
@Chett23
Copy link

Chett23 commented Apr 8, 2020

@jondcoleman, How would one implement this? is the script embedded into a ZAT platform app or is it implemented via browser extension?

@jondcoleman
Copy link
Author

jondcoleman commented Apr 8, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment