VK Blur Remover

Removes blur, overlays, and auto play vkontakte videos.

当前为 2025-01-08 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name VK Blur Remover
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.3
  5. // @description Removes blur, overlays, and auto play vkontakte videos.
  6. // @author 1axx
  7. // @license MIT
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=vk.com
  9. // @match https://vk.com/*
  10. // @match https://vkvideo.ru/*
  11. // @match *://vk.com/*
  12. // @match *://vk.ru/*
  13. // @match *://*.vk.com/*
  14. // @match *://*.vk.ru/*
  15. // @match *://*.vk-cdn.com/*
  16. // @match *://*.vk-cdn.net/*
  17. // @match *://*.mycdn.me/*
  18. // @match *://*.userapi.com/*
  19. // @match *://*.vkuseraudio.net/*
  20. // @match *://*.vkuseraudio.ru/*
  21. // @match *://*.vkuservideo.net/*
  22. // @match *://*.vkuser.net/*
  23. // @match *://*.pladform.ru/*
  24. // @grant none
  25. // ==/UserScript==
  26.  
  27. (function () {
  28. 'use strict';
  29.  
  30. // Keywords to check
  31. const keywords = ['age-restricted', 'blurred', 'restriction', 'video', 'restricted'];
  32.  
  33. // Function to dynamically check and hide/remove based on content and attributes
  34. function processElements() {
  35. // Select all elements in the document
  36. const allElements = document.querySelectorAll('*');
  37.  
  38. allElements.forEach(element => {
  39. let shouldRemove = false;
  40. let elementText = element.innerText || ''; // Get text inside the element
  41. let elementAttributes = Array.from(element.attributes); // Get attributes of the element
  42.  
  43. // Check if element has text matching any keywords
  44. const lowerCaseText = elementText.toLowerCase();
  45. keywords.forEach(keyword => {
  46. if (lowerCaseText.includes(keyword)) {
  47. shouldRemove = true;
  48. }
  49. });
  50.  
  51. // Check if element's attributes contain any keywords (like titles, alt, etc.)
  52. elementAttributes.forEach(attr => {
  53. if (attr.value.toLowerCase().includes('blur') || attr.value.toLowerCase().includes('restriction')) {
  54. shouldRemove = true;
  55. }
  56. });
  57.  
  58. // If the element has specific content that matches the keywords, remove or hide it
  59. if (shouldRemove) {
  60. // Handle SVG icons with unwanted classes
  61. if (element.classList.contains('vkuiIcon--hide_outline_28')) {
  62. element.remove();
  63. }
  64. // Handle blurred preview images
  65. else if (element.classList.contains('vkitVideoCardPreviewImage__imgBlurred--GNE6S')) {
  66. element.style.filter = 'none'; // Remove blur effect
  67. element.style.opacity = '1'; // Ensure full visibility
  68. }
  69. // Handle age-restricted overlay and other similar elements
  70. else if (element.classList.contains('vkitVideoCardRestrictionOverlay__restriction--EP1HY') ||
  71. element.classList.contains('vkitVideoCardRestrictionOverlay__restrictionLayoutLight--IPSP6') ||
  72. element.classList.contains('vkitOverlay__root--AjJAj') ||
  73. element.classList.contains('vkitVideoCardRestrictionOverlay__title--qz1zh')) {
  74. element.style.display = 'none'; // Hide the overlay completely
  75. element.style.pointerEvents = 'none';
  76. }
  77. }
  78.  
  79. if (element.classList.contains('VideoRestriction__button')) {
  80. element.click();
  81. console.log('Auto-clicked the "Look" button');
  82. }
  83. });
  84. }
  85.  
  86. // Wait
  87. window.addEventListener('load', function() {
  88. // Observe changes to the DOM and apply fixes dynamically
  89. const observer = new MutationObserver(processElements);
  90. observer.observe(document.body, { childList: true, subtree: true });
  91. processElements(); // Initial run to process existing content
  92. });
  93. })();