Created
January 29, 2015 21:50
-
-
Save danalexilewis/8f54d8177fc59ff3246d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name anilinkz | |
// @namespace anime | |
// @description getting rid of CM's dumb ass styling | |
// @include http://anilinkz.com/* | |
// @version 1 | |
// @grant MIT Licence | |
// ==/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); | |
} | |
function removeElement(node) { | |
node.parentNode.removeChild(node); | |
} | |
function removeNodeById(id){ | |
var adSidebar = document.getElementById(id); | |
if (adSidebar) { | |
adSidebar.parentNode.removeChild(adSidebar); | |
} | |
} | |
function removeTagChildNode(tag, child){ | |
var el = document.getElementsByTagName(tag)[0]; | |
if (el) { | |
el.removeChild(el.childNodes[child]); | |
} | |
} | |
function removeChildNode(id, child){ | |
var adSidebar = document.getElementById(id); | |
if (adSidebar) { | |
adSidebar.removeChild(adSidebar.childNodes[child]); | |
} | |
} | |
function removeClassChildNode(classi){ | |
var classy = document.getElementsByClassName(classi)[0]; | |
if (classy) { | |
removeElement(classy); | |
} | |
} | |
removeClassChildNode("kwarta la epla"); | |
removeClassChildNode("kwarta sa epsa"); | |
removeNodeById('tago'); | |
removeNodeById('rightside'); | |
//removeTagChildNode('main', 1); | |
//removeTagChildNode('main', 3); | |
addGlobalStyle('main {width: 100% !important} #nextprevlist {float:none !important; width: auto !important} .la {height:0 !important;} #pagenavi {float:left !important;}) '); | |
//removeChildNode('rightside', 1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment