Last active
April 8, 2020 20:32
-
-
Save jondcoleman/3a171848e1ec6a902b7798af4b6b5c3d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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()) | |
} | |
}) | |
})() |
This is designed to be used with browser extension. In Chrome,
Tampermonkeky.
https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo?hl=en
Although it could likely be put into a ZAT app.
…On Wed, Apr 8, 2020 at 4:16 PM Chester Hansen ***@***.***> wrote:
***@***.**** commented on this gist.
------------------------------
@jondcoleman <https://github.com/jondcoleman>, How would one implement
this? is the script embedded into a ZAT platform app or is it implemented
via browser extension?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<https://gist.github.com/3a171848e1ec6a902b7798af4b6b5c3d#gistcomment-3246178>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AC2LQT7PZ2SYPOTKEOESTA3RLTLSHANCNFSM4MEGSPMQ>
.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@jondcoleman, How would one implement this? is the script embedded into a ZAT platform app or is it implemented via browser extension?