Skip to content

Instantly share code, notes, and snippets.

@fearthecowboy
Created July 21, 2015 15:54
Show Gist options
  • Save fearthecowboy/4bcb2ce4e57f18055bef to your computer and use it in GitHub Desktop.
Save fearthecowboy/4bcb2ce4e57f18055bef to your computer and use it in GitHub Desktop.
Greasemonkey script to fix my background on Twitter
// ==UserScript==
// @name Set background back to what it should be
// @namespace http://fearthecowboy.com
// @description Changes twitter's new image-less background to something I can stand
// @include https://twitter.com/*
// @grant none
// @version 1.0
// ==/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);
}
// turns out my background image is at:
// background-image: url(https://pbs.twimg.com/profile_background_images/529661762623139841/zHIQPX3T.png);
addGlobalStyle('body { background-image: url(https://pbs.twimg.com/profile_background_images/529661762623139841/zHIQPX3T.png); }');
document.getElementById('page-outer').setAttribute("style", "background-image: url(https://pbs.twimg.com/profile_background_images/529661762623139841/zHIQPX3T.png);");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment