Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Zive.CZ chapter remover
- // @description Removes chapters in articles on website Zive.CZ
- // @author BetonMAN
- // @website http://www.zive.cz/
- // @version 1.1
- //
- // Copyright (c) 2013 BetonMAN
- //
- // @include http://zive.cz/*
- // @include http://www.zive.cz/*
- //
- // @history 1.0 Initial release
- // @history 1.1 Chapters are read from list instead of select menu
- //
- // ==/UserScript==
- (function(c,d){c.log("Zive.CZ chapter remover - Coded by BetonMAN");(function(){if(d.body){c.log("Detecting chapters...");var te=d.querySelectorAll(".box.box-tabbed.noprint");if(te.length){c.log("Chapters detected, removing them...");var rc=function(cn){cs=d.getElementsByClassName(cn);while(cs[0]){re(cs[0])}},re=function(e){e.parentNode.removeChild(e)},o=te[0].querySelectorAll("a"),co=document.getElementById("main-article"),i=t=0;for(;t<te.length;t++){re(te[t]);};(function(){if(i>0){co.innerHTML+=this.responseXML.getElementById("main-article").innerHTML;}if(o[i]){c.log("Loading chapter No. "+(i+2));var r=new XMLHttpRequest();r.onload=arguments.callee;r.open("GET",o[i].href);r.responseType="document";r.send();}else{rc("button-row-new");}i++;})();}}else{setTimeout(arguments.callee,0);}})();})(console,document);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement