您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Get rid of login popup/blocking on GeeksForGeeks.
// ==UserScript== // @name GeeksForGeeks Login Bypass // @namespace http://tampermonkey.net/ // @version 0.1 // @description Get rid of login popup/blocking on GeeksForGeeks. // @match https://www.geeksforgeeks.org/* // @icon https://www.google.com/s2/favicons?sz=64&domain=geeksforgeeks.org // @grant none // @license MIT // ==/UserScript== var lastScrollPos = 0; (function() { 'use strict'; // Your code here... let observer = new MutationObserver(reactToMutation); var domToWatch = document.querySelector('body') observer.observe(domToWatch, { characterDataOldValue: true, subtree: true, childList: true, characterData: true }); })(); function reactToMutation(mutations) { mutations.forEach((mutation) => { let oldValue = mutation.oldValue; let newValue = mutation.target; if (oldValue !== newValue) { var spinnerLoadingOverlay = newValue.querySelector('div.spinner-loading-overlay') // spinner overlay is present and visible if(spinnerLoadingOverlay && spinnerLoadingOverlay.style.display === 'block') { // remove the annoying overlay spinnerLoadingOverlay.remove() // save scroll position, site brings you back to the top if(document.documentElement.scrollTop > 0) { lastScrollPos = document.documentElement.scrollTop } } var loginModal = newValue.querySelector('div.login-modal-div') // login modal is present and visible if(loginModal && loginModal.style.display === 'block') { // remove login modal loginModal.remove() // remove css scrolling restriction var body = document.querySelector('body') body.style.position = 'relative' body.style.overflow = 'visible' // nullify scoll event listener that blocks you window.onscroll = null // scroll back to where you were if(lastScrollPos > 0) { document.documentElement.scrollTo(0, lastScrollPos) } } } }); }