Remove Search and Copy Popup

自动移除“Search”和“Copy”弹出框

目前为 2024-09-22 提交的版本。查看 最新版本

// ==UserScript==
// @name         Remove Search and Copy Popup
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  自动移除“Search”和“Copy”弹出框
// @author       YourName
// @match        *://*.sciencedirect.com/*
// @match        *://*.science-direct.com/*
// @match        *://*sciencedirect*/*
// @match        *://*science-direct*/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=example.com
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // 定义一个函数,用来移除弹出框
    function removePopup() {
        // 获取页面中带有class "search-for-selected-text" 的元素
        const popup = document.querySelector('.search-for-selected-text');
        if (popup) {
            popup.remove();  // 移除该元素
            console.log('Search and Copy popup removed.');
        }
    }

    // 页面加载完成时运行
    window.addEventListener('load', function() {
        // 初次运行一次
        removePopup();

        // 设置一个定时器,每隔500毫秒检查一次
        setInterval(removePopup, 500);
    });

})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址