Studocu Premium Banner Bypass

Remove premium banner & blur of Studocu document

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Studocu Premium Banner Bypass
// @namespace    https://github.com/DemonDucky
// @version      1.0,1
// @description  Remove premium banner & blur of Studocu document
// @author       DemonDucky
// @match        https://www.studocu.com/*/document/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=studocu.com
// @grant        GM_addStyle
// @license MIT
// ==/UserScript==

(function () {
  'use strict';

  const css = `
    .removefilter {
      filter: none !important;
      user-select: auto !important;
    }
  `;

  function loadHandler() {
    GM_addStyle(css);
    removeBlur();
    removeBanner();
  }

  function removeBlur() {
    const pageContainerChilds =
      document.querySelector('#page-container').childNodes;
    const pagesContent = document.querySelectorAll('.page-content');

    pageContainerChilds.forEach(element => {
      element.childNodes[1]?.remove();
    });

    pagesContent.forEach(element => {
      element.classList.add('removefilter');
    });
  }

  function removeBanner() {
    const previewPopUp = document.querySelector('#document-wrapper');
    const bannerWrapper = document.querySelectorAll('.banner-wrapper');
    if (previewPopUp.childNodes.length >= 2) {
      previewPopUp.childNodes[1].childNodes[0].remove();
    }

    bannerWrapper.forEach(element => {
      element.remove();
    });
  }

  window.addEventListener('load', loadHandler);
})();