Skip to content

Instantly share code, notes, and snippets.

@jalex19100
Last active March 11, 2016 18:49
Show Gist options
  • Select an option

  • Save jalex19100/0622422977de1aead689 to your computer and use it in GitHub Desktop.

Select an option

Save jalex19100/0622422977de1aead689 to your computer and use it in GitHub Desktop.
Twitter cleanup
// ==UserScript==
// @name Remove Twitter Inline Images
// @namespace fixTheTwittersNet
// @version 0.2
// @include /^https?://www\.twitter\.com/.*$/
// @include /^https?://twitter\.com/.*$/
// @author This dude
// @description This script removes inline images until you click the expand button
// ==/UserScript==
/* jshint -W097 */
'use strict';
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('.stream-item .cards-media-container { display: none !important; }');
//addGlobalStyle('.stream-item.open .cards-media-container { display: block !important; }');
//addGlobalStyle('.stream-item .expanded-content { display: none !important; }');
//addGlobalStyle('.stream-item.open .expanded-content { display: block !important; }');
//document.getElementsByTagName('AdaptiveMedia.is-square')
addGlobalStyle('.stream-item .AdaptiveMedia { display: none !important; }');
addGlobalStyle('.stream-item.open .AdaptiveMedia { display: block !important; }');
addGlobalStyle('.stream-item .js-media-container { display: none !important; }');
addGlobalStyle('.stream-item.open .js-media-container { display: block !important; }');
addGlobalStyle('.dashboard-right { display: none !important; }');
addGlobalStyle('.dashboard-left { display: none !important; }');
addGlobalStyle('.avatar { display: none !important; }');
addGlobalStyle('.stream-item .expanded-content { display: none !important; }');
addGlobalStyle('.stream-item.open .expanded-content { display: block !important; }');
document.getElementsByClassName("content-main")[0].removeAttribute("class");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment