Skip to content

Instantly share code, notes, and snippets.

@BriceShatzer
Last active March 1, 2016 16:54
Show Gist options
  • Save BriceShatzer/7b6347e37d11e8f6b45b to your computer and use it in GitHub Desktop.
Save BriceShatzer/7b6347e37d11e8f6b45b to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Replace investors.com stylesheet with local copy
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @run-at document-start
// @match http://www.investors.com/*
// @match http://www.dev7investors.com/news*
// @grant none
// ==/UserScript==
/* jshint -W097 */
'use strict';
/*
for (var i = document.styleSheets.length - 1; i >= 0; i--) {
document.styleSheets[i].disabled = true;
}
*/
window.onload =function(){
for (var i = document.styleSheets.length - 1; i >= 0; i--) {
if( document.styleSheets[i].href == 'http://www.investors.com/wp-content/themes/ibd/dist/styles/main.css'){
console.dir(document.styleSheets[i]);
document.styleSheets[i].disabled = true;
}
}
}
var link = document.createElement('link');
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = 'http://investors.app/wp-content/themes/ibd/dist/styles/main.css';
document.getElementsByTagName("head")[0].appendChild(link);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment