Last active
December 4, 2019 15:25
-
-
Save greatghoul/000cb1dbfb549faedcc482f7866f9592 to your computer and use it in GitHub Desktop.
ZenDesk Private Comment By Default
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 ZenDesk Private Comment By Default | |
// @namespace greatghoul | |
// @version 0.1 | |
// @description ZenDesk Private Comment By Default | |
// @author greatghoul | |
// @match https://*.zendesk.com/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
document.addEventListener('click', e => { | |
if (e.target.classList.contains('track-id-publicComment') && e.target.classList.contains('btn')) { | |
e.target.setAttribute('data-click-mode', 'manual') | |
} | |
}, false) | |
window.setInterval(() => { | |
const btn = document.querySelector('.btn.private_note:not(.active)') | |
const isManualMode = document.querySelector('.btn[data-click-mode="manual"]') | |
btn && !isManualMode && btn.click() | |
}, 300) | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment