Skip to content

Instantly share code, notes, and snippets.

@akuhn
Last active December 27, 2015 03:09
Show Gist options
  • Save akuhn/7257131 to your computer and use it in GitHub Desktop.
Save akuhn/7257131 to your computer and use it in GitHub Desktop.
Don’t like Twitter's new photo preview? Same here. Fixed.
// ==UserScript==
// @name Disable Photo Preview on Twitter
// @namespace http://example.com
// @description hacked with love by @akuhn
// @include https://twitter.com/*
// @version 1
// @grant none
// ==/UserScript==
function addGlobalStyle(css) {
var head, style;
head = document.getElementsByTagName('head')[0];
if (!head) { return; }
style = document.createElement('style');
style.type = 'text/css';
style.innerHTML = css;
head.appendChild(style);
}
addGlobalStyle(".with-media-forward .cards-base .media-forward { max-height: 0px; }");
addGlobalStyle(".with-media-forward.opened-tweet .media-forward { max-height: none; }");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment