Skip to content

Instantly share code, notes, and snippets.

@gitnik
Last active April 19, 2018 13:44
Show Gist options
  • Select an option

  • Save gitnik/063dc9cdf91bc18cd6180b39092af2ee to your computer and use it in GitHub Desktop.

Select an option

Save gitnik/063dc9cdf91bc18cd6180b39092af2ee to your computer and use it in GitHub Desktop.

Revisions

  1. gitnik revised this gist Apr 19, 2018. 1 changed file with 16 additions and 8 deletions.
    24 changes: 16 additions & 8 deletions intercom.js
    Original file line number Diff line number Diff line change
    @@ -7,16 +7,24 @@

    (function() {
    'use strict';

    window.onpopstate

    document.onreadystatechange = function () {
    if (document.readyState === "complete") {
    const conversationContainer = document.querySelector('.conversation__text');

    conversationContainer.querySelectorAll('p:not(:empty)').forEach((node) => {
    if (node.innerText.startsWith('data:image/gif;base64')) {
    node.remove();
    }
    });
    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();
    }
    });
    }
  2. gitnik created this gist Apr 19, 2018.
    22 changes: 22 additions & 0 deletions intercom.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    // ==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';

    document.onreadystatechange = function () {
    if (document.readyState === "complete") {
    const conversationContainer = document.querySelector('.conversation__text');

    conversationContainer.querySelectorAll('p:not(:empty)').forEach((node) => {
    if (node.innerText.startsWith('data:image/gif;base64')) {
    node.remove();
    }
    });
    }
    };
    })();