Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- javascript:(function() {
- function hasTargetVideo(el) {
- if (!el) return false;
- return el.innerHTML.includes('video.twimg.com%2Ftweet_video%2F') || el.innerHTML.includes('video.twimg.com/tweet_video/');
- }
- var items = document.querySelectorAll('.timeline-item, article, [data-testid="tweet"]');
- var removed = 0;
- items.forEach(function(item) {
- if (hasTargetVideo(item)) {
- item.remove();
- removed++;
- }
- });
- function showToast(msg) {
- var existing = document.getElementById('tweet-toast');
- if (existing) existing.remove();
- var isDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
- var toast = document.createElement('div');
- toast.id = 'tweet-toast';
- toast.textContent = msg;
- toast.style.position = 'fixed';
- toast.style.bottom = '24px';
- toast.style.right = '24px';
- toast.style.zIndex = 9999;
- toast.style.maxWidth = '90vw';
- toast.style.padding = '14px 24px';
- toast.style.borderRadius = '8px';
- toast.style.fontSize = '16px';
- toast.style.boxShadow = '0 4px 24px rgba(0,0,0,0.11)';
- toast.style.transition = 'opacity 0.4s';
- toast.style.opacity = 1;
- toast.style.background = isDark ? '#222' : '#fff';
- toast.style.color = isDark ? '#fff' : '#222';
- toast.style.border = '1px solid ' + (isDark ? '#444' : '#e0e0e0');
- document.body.appendChild(toast);
- setTimeout(function() {
- toast.style.opacity = 0;
- setTimeout(function() { toast.remove(); }, 400);
- }, 2500);
- }
- showToast('Removed ' + removed + ' items w/ tweet_video links.');
- })();
Advertisement
Add Comment
Please, Sign In to add comment