VanishIt

通过快速 Alt+右键操作,让任何页面元素轻松消失。

  1. // ==UserScript==
  2. // @name VanishIt
  3. // @namespace https://gf.qytechs.cn/en/users/1451802
  4. // @version 1.0
  5. // @description Make any page element disappear effortlessly using a quick Alt+Right-click.
  6. // @description:de Lassen Sie jedes Element der Seite mühelos verschwinden – mit einem schnellen Alt+Rechtsklick.
  7. // @description:es Haz desaparecer cualquier elemento de la página sin esfuerzo con un rápido Alt+Clic derecho.
  8. // @description:fr Faites disparaître n'importe quel élément de la page en un clin d'œil grâce à un rapide Alt+Clic droit.
  9. // @description:it Fai sparire qualsiasi elemento della pagina senza sforzo usando un rapido Alt+Clic destro.
  10. // @description:ru С легкостью заставьте любой элемент страницы исчезнуть с помощью быстрого Alt+правого клика.
  11. // @description:zh-CN 通过快速 Alt+右键操作,让任何页面元素轻松消失。
  12. // @description:zh-TW 透過快速 Alt+右鍵操作,輕鬆讓任何頁面元素消失。
  13. // @description:ja Alt+右クリックを使って、どんなページ要素も簡単に消し去ります。
  14. // @description:ko 빠른 Alt+우클릭으로 페이지의 모든 요소를 손쉽게 제거합니다.
  15. // @author NormalRandomPeople (https://github.com/NormalRandomPeople)
  16. // @match *://*/*
  17. // @grant none
  18. // @icon https://www.svgrepo.com/show/253495/erase-clean.svg
  19. // @compatible chrome
  20. // @compatible firefox
  21. // @compatible opera
  22. // @compatible edge
  23. // @compatible brave
  24. // @license MIT
  25. // ==/UserScript==
  26.  
  27. (function() {
  28. 'use strict';
  29.  
  30. const customMenu = document.createElement('div');
  31. customMenu.style.position = 'absolute';
  32. customMenu.style.backgroundColor = '#fff';
  33. customMenu.style.border = '1px solid #ccc';
  34. customMenu.style.padding = '5px 10px';
  35. customMenu.style.boxShadow = '2px 2px 6px rgba(0,0,0,0.2)';
  36. customMenu.style.zIndex = 999999999;
  37. customMenu.style.display = 'none';
  38. customMenu.style.fontFamily = 'Arial, sans-serif';
  39. customMenu.style.fontSize = '14px';
  40. customMenu.style.cursor = 'pointer';
  41. customMenu.textContent = 'Destroy';
  42. customMenu.addEventListener('mouseover', () => {
  43. customMenu.style.backgroundColor = '#eee';
  44. });
  45. customMenu.addEventListener('mouseout', () => {
  46. customMenu.style.backgroundColor = '#fff';
  47. });
  48. document.body.appendChild(customMenu);
  49.  
  50. let targetElement = null;
  51.  
  52. document.addEventListener('contextmenu', (e) => {
  53. if (e.altKey) {
  54. e.preventDefault();
  55. targetElement = e.target;
  56. customMenu.style.top = `${e.pageY}px`;
  57. customMenu.style.left = `${e.pageX}px`;
  58. customMenu.style.display = 'block';
  59. } else {
  60. customMenu.style.display = 'none';
  61. }
  62. });
  63.  
  64. customMenu.addEventListener('click', (e) => {
  65. if (targetElement && targetElement.parentNode) {
  66. targetElement.parentNode.removeChild(targetElement);
  67. }
  68. customMenu.style.display = 'none';
  69. e.stopPropagation();
  70. });
  71.  
  72. document.addEventListener('click', () => {
  73. customMenu.style.display = 'none';
  74. });
  75. })();

QingJ © 2025

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