Last active
December 10, 2015 02:28
-
-
Save duncan-bayne/fb41394975da142852d1 to your computer and use it in GitHub Desktop.
No More Giphy™
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 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