Advertisement
BetonMAN

Zive.CZ chapter remover

Nov 27th, 2013
384
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name           Zive.CZ chapter remover
  3. // @description    Removes chapters in articles on website Zive.CZ
  4. // @author         BetonMAN
  5. // @website        http://www.zive.cz/
  6. // @version        1.1
  7. //
  8. // Copyright (c) 2013 BetonMAN
  9. //
  10. // @include        http://zive.cz/*
  11. // @include        http://www.zive.cz/*
  12. //
  13. // @history        1.0 Initial release
  14. // @history        1.1 Chapters are read from list instead of select menu
  15. //
  16. // ==/UserScript==
  17.  
  18. (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