Skip to content

Instantly share code, notes, and snippets.

@jondcoleman
Last active April 8, 2020 20:32
Show Gist options
  • Select an option

  • Save jondcoleman/3a171848e1ec6a902b7798af4b6b5c3d to your computer and use it in GitHub Desktop.

Select an option

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

Chett23 commented Apr 8, 2020

Copy link
Copy Markdown

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

@jondcoleman

jondcoleman commented Apr 8, 2020 via email

Copy link
Copy Markdown
Author

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