Skip to content

Instantly share code, notes, and snippets.

@gitnik
Last active April 19, 2018 13:44
Show Gist options
  • Save gitnik/063dc9cdf91bc18cd6180b39092af2ee to your computer and use it in GitHub Desktop.
Save gitnik/063dc9cdf91bc18cd6180b39092af2ee to your computer and use it in GitHub Desktop.
Remove base64 from intercom conversations
// ==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