Skip to content

Instantly share code, notes, and snippets.

@karlding
Created July 22, 2015 01:29
Show Gist options
  • Save karlding/f6c5063142a9803cbb55 to your computer and use it in GitHub Desktop.
Save karlding/f6c5063142a9803cbb55 to your computer and use it in GitHub Desktop.
Hide media previews (video and images) in the HipChat web client
// ==UserScript==
// @name HipChat Hide Media Previews
// @namespace github.com/karlding
// @version 0.1.0
// @description Hide Media Previews (video and images) in the HipChat web client
// @author Karl Ding
// @match https://*.hipchat.com/chat/*
// @license MIT
// ==/UserScript==
var css = '.video-wrap {visibility: hidden;}\n.hc-chat-row:hover .video-wrap {visibility:visible;}\n.hc-chat-row .image-preview-wrapper {visibility:hidden;}\n.hc-chat-row:hover .image-preview-wrapper {visibility:visible}',
head = document.head || document.getElementsByTagName('head')[0],
style = document.createElement('style');
style.type = 'text/css';
if (style.styleSheet){
style.styleSheet.cssText = css;
} else {
style.appendChild(document.createTextNode(css));
}
head.appendChild(style);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment