Skip to content

Instantly share code, notes, and snippets.

@greatghoul
Last active December 4, 2019 15:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save greatghoul/000cb1dbfb549faedcc482f7866f9592 to your computer and use it in GitHub Desktop.
Save greatghoul/000cb1dbfb549faedcc482f7866f9592 to your computer and use it in GitHub Desktop.
ZenDesk Private Comment By Default
// ==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