Last active
April 19, 2018 13:44
-
-
Save gitnik/063dc9cdf91bc18cd6180b39092af2ee to your computer and use it in GitHub Desktop.
Remove base64 from intercom conversations
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 Intercom Base64 Remover | |
// @author Nik Karbaum | |
// @namespace https://app.intercom.io | |
// @include https://app.intercom.io/a/apps/*/inbox/inbox/conversation/* | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
window.onpopstate | |
document.onreadystatechange = function () { | |
if (document.readyState === "complete") { | |
doShit(); | |
} | |
}; | |
window.onpopstate = doShit(); | |
})(); | |
function doShit() { | |
const conversationContainer = document.querySelector('.conversation__text'); | |
conversationContainer.querySelectorAll('p:not(:empty)').forEach((node) => { | |
if (node.innerText.startsWith('data:image/gif;base64')) { | |
node.remove(); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment