Created
May 3, 2017 03:48
-
-
Save patrikvarga/7cbc0efddaf5f58e7c45bc263e89ad81 to your computer and use it in GitHub Desktop.
Remove annoying e-mail signatures from Zendesk comments
This file contains hidden or 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 signature remover | |
// @namespace http://tampermonkey.net/ | |
// @description Remove annoying e-mail signatures from Zendesk comments | |
// @version 0.1 | |
// @author patrik | |
// @match YOUR_MATCH_HERE... | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
console.log("Zendesk signature remover loaded."); | |
$("div#main_panes").on("DOMNodeInserted", function(e) { | |
var node = e.target; | |
var parentId = node.parentNode.id; | |
if ("main_panes" === parentId) { | |
// Common e-mail endings | |
var regards = $("div.zd-comment p:contains('Best Regards,')"); | |
console.log("Removing " + regards.length + " regards signatures."); | |
regards.nextAll().remove(); | |
regards.remove(); | |
var regards2 = $("div.zd-comment p:contains('Best regards,')"); | |
console.log("Removing " + regards2.length + " regards signatures."); | |
regards2.nextAll().remove(); | |
regards2.remove(); | |
// Signature DIV | |
var divSignature = $("div.zd-comment div.signature"); | |
console.log("Removing " + divSignature.length + " signature divs."); | |
divSignature.remove(); | |
// Add your own... | |
} | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment