消除js Remove JS Button

在当前页添加一个删除指定的html标签的按钮,点击后会自动删除JS。

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

You will need to install an extension such as Tampermonkey to install this script.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

You will need to install an extension such as Tampermonkey to install this script.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         消除js Remove JS Button
// @namespace    消除js Remove JS Button
// @license      yagizaMJ
// @version      1.1.1
// @description  在当前页添加一个删除指定的html标签的按钮,点击后会自动删除JS。
// @AuThor       yagizaMJ
// @match        *://*/*
// @grant        none
// ==/UserScript==
 
(function() {
    'use strict';
 
    function removeTags(tagNames) {
        tagNames.forEach(function(tagName) {
            // 获取所有指定标签
            var elements = document.querySelectorAll(tagName);
 
            // 遍历所有的指定标签并移除它们
            elements.forEach(function(element) {
                element.parentNode.removeChild(element);
            });
        });
    }
 
    // 创建按钮元素
    var removeButton = document.createElement('button');
    removeButton.textContent = 'Remove JS';
    removeButton.style.position = 'fixed';
    removeButton.style.top = '250px';
    removeButton.style.right = '20px';
    removeButton.style.zIndex = '9999';
 
    // 将按钮添加到页面上
    document.body.appendChild(removeButton);
 
    // 添加按钮点击事件
    removeButton.addEventListener('click', function() {
        // 调用函数删除 <a> 和 <h1> 标签
        removeTags(['link', 'script']);
 
        // 移除按钮自身
        removeButton.parentNode.removeChild(removeButton);
    });
 
    // 隐藏按钮的右键菜单
    removeButton.addEventListener('contextmenu', function(event) {
        event.preventDefault();
        removeButton.style.display = 'none';
    });
 
    // 当文档双击时,恢复按钮
    document.addEventListener('dblclick', function() {
        removeButton.style.display = 'block';
    });
})();