Skip to content

Instantly share code, notes, and snippets.

@duncan-bayne
Last active December 10, 2015 02:28
Show Gist options
  • Save duncan-bayne/fb41394975da142852d1 to your computer and use it in GitHub Desktop.
Save duncan-bayne/fb41394975da142852d1 to your computer and use it in GitHub Desktop.
No More Giphy™
// ==UserScript==
// @name No More Giphy™
// @namespace duncan@bayne.id.au
// @description Hides all Slack messages from /giphy
// @include /https:\/\/.*\.slack\.com\/messages\/.*/
// @version 2
// @grant GM_log
// @require http://code.jquery.com/jquery-2.1.4.min.js
// @require http://underscorejs.org/underscore-min.js
// ==/UserScript==
var MutationObserver = window.MutationObserver;
var myObserver = new MutationObserver (_.debounce(function() { $('span.message_body:contains("/giphy")').children('div.inline_attachment').hide(), 1000));
var obsConfig = { childList: true, attributes: true, subtree: true };
myObserver.observe (document, obsConfig);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment