Studocu_Remove_Blur

Remove blur in studocu.com and other annoying things. You can click the button at the right bottom to do so.

  1. // ==UserScript==
  2. // @name Studocu_Remove_Blur
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description Remove blur in studocu.com and other annoying things. You can click the button at the right bottom to do so.
  6. // @author You
  7. // @match https://www.studocu.com/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=studocu.com
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function () {
  14. 'use strict';
  15.  
  16. // alert("Trying lol");
  17. let waitTime = 3000; // 3000ms to start remove frontShit
  18.  
  19. const timeout = setTimeout(() => {
  20. main();
  21. }, waitTime);
  22.  
  23. function main(){
  24. let frontShit = document.querySelectorAll('#document-wrapper')[0].childNodes[0];
  25. frontShit.remove();
  26. let frontShit2 = document.querySelectorAll('h2');
  27. for (let i = 0; i < frontShit2.length; i++) {
  28. const shit = frontShit2[i];
  29. let shitWords = "Why is this page out of focus?";
  30. if (shit.innerHTML.indexOf(shitWords) != -1) { // shitWords in innerHTML
  31. console.log(shit);
  32. shit.parentElement.parentElement.remove();
  33. }
  34. }
  35.  
  36. let clearBlur = ()=>{
  37. let blurDivs = document.querySelectorAll('.page-content');
  38. for (let i = 0; i < blurDivs.length; i++) {
  39. const blurDiv = blurDivs[i];
  40. let blurWords = "filter: blur(4px);";
  41. if (blurDiv.outerHTML.indexOf(blurWords) != -1) {
  42. console.log(blurDiv);
  43. while (blurDiv.hasChildNodes()){// lifting all the children
  44. blurDiv.parentNode.insertBefore(blurDiv.firstChild,blurDiv);
  45. }
  46. blurDiv.parentNode.removeChild(blurDiv);
  47. }
  48. }
  49. };
  50.  
  51.  
  52. // Create a big red button for the user to click.
  53.  
  54. let button = document.createElement("button");
  55. button.innerHTML = "Clear Blur";
  56. button.style.cssText = "position: fixed; bottom: 20px; right: 20px;";
  57. button.onclick = () => {
  58. clearBlur();
  59. }
  60. button.style.backgroundColor = 'blue';
  61. button.style.color = 'white';
  62. button.style.padding = '5px';
  63. button.style.border = 'none';
  64. button.style.cursor = 'pointer';
  65. button.style.fontSize = '20px';
  66. button.style.zIndex = '9999';
  67. // Add round border to the button.
  68. button.style.borderRadius = '10%';
  69. // Add a shadow to the button.
  70. button.style.boxShadow = '0px 0px 5px black';
  71. document.body.appendChild(button);
  72.  
  73. // Too many repeated execution will result in a blank page for unknown reasons.
  74. }
  75.  
  76. })();