Guest User

Untitled

a guest
Jun 17th, 2025
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. javascript:(function() {
  2.     function hasTargetVideo(el) {
  3.         if (!el) return false;
  4.         return el.innerHTML.includes('video.twimg.com%2Ftweet_video%2F') || el.innerHTML.includes('video.twimg.com/tweet_video/');
  5.     }
  6.     var items = document.querySelectorAll('.timeline-item, article, [data-testid="tweet"]');
  7.     var removed = 0;
  8.     items.forEach(function(item) {
  9.         if (hasTargetVideo(item)) {
  10.             item.remove();
  11.             removed++;
  12.         }
  13.     });
  14.     function showToast(msg) {
  15.         var existing = document.getElementById('tweet-toast');
  16.         if (existing) existing.remove();
  17.         var isDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
  18.         var toast = document.createElement('div');
  19.         toast.id = 'tweet-toast';
  20.         toast.textContent = msg;
  21.         toast.style.position = 'fixed';
  22.         toast.style.bottom = '24px';
  23.         toast.style.right = '24px';
  24.         toast.style.zIndex = 9999;
  25.         toast.style.maxWidth = '90vw';
  26.         toast.style.padding = '14px 24px';
  27.         toast.style.borderRadius = '8px';
  28.         toast.style.fontSize = '16px';
  29.         toast.style.boxShadow = '0 4px 24px rgba(0,0,0,0.11)';
  30.         toast.style.transition = 'opacity 0.4s';
  31.         toast.style.opacity = 1;
  32.         toast.style.background = isDark ? '#222' : '#fff';
  33.         toast.style.color = isDark ? '#fff' : '#222';
  34.         toast.style.border = '1px solid ' + (isDark ? '#444' : '#e0e0e0');
  35.         document.body.appendChild(toast);
  36.         setTimeout(function() {
  37.             toast.style.opacity = 0;
  38.             setTimeout(function() { toast.remove(); }, 400);
  39.         }, 2500);
  40.     }
  41.     showToast('Removed ' + removed + ' items w/ tweet_video links.');
  42. })();
  43.  
Advertisement
Add Comment
Please, Sign In to add comment