Jump to content

WatchLater-deletion-Bookmark-260124

From Game in the Brain Wiki
Revision as of 16:36, 23 January 2026 by Justinaquino (talk | contribs) (Created page with "== Wiki Guide: Reclaiming Your Time with the "Clean Watch Later" Script == === Context & Methodology === This workflow is designed for users who want to break the "YouTube Trap." By '''disabling Watch History''', you effectively kill the YouTube algorithm's ability to feed you distracting recommendations and addictive '''YouTube Shorts''' that can lead to late-night scrolling and "revenge bedtime procrastination." ==== How it Works: ==== '''The Queue:''' Instead of br...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Wiki Guide: Reclaiming Your Time with the "Clean Watch Later" Script

Context & Methodology

This workflow is designed for users who want to break the "YouTube Trap." By disabling Watch History, you effectively kill the YouTube algorithm's ability to feed you distracting recommendations and addictive YouTube Shorts that can lead to late-night scrolling and "revenge bedtime procrastination."

How it Works:

The Queue: Instead of browsing the Home feed, you use the Watch Later list as your primary viewing queue.

Intentionality: You only watch what you manually added.

The Problem: YouTube makes it notoriously difficult to bulk-delete videos from "Watch Later." Once you've watched your queue, you need a way to purge it quickly so you can start fresh for the next day.

The Solution: The "Clean Watch Later" Bookmarklet

This is a tiny piece of JavaScript that lives in your bookmarks bar. When clicked on the Watch Later page, it triggers a popup asking how many videos you want to remove and then automates the clicking process for you.

Step 1: Create the Bookmark (LibreWolf / Firefox)

Ensure your Bookmarks Toolbar is visible (Ctrl + Shift + B).

Right-click an empty space on the toolbar and select Add Bookmark....

Name: Clear Watch Later

URL: Copy and paste the code block below exactly:

javascript:(async () => {
/* 1. Request user input for deletion limit */
const userInput = prompt("How many Watch Later videos do you want to delete?", "50");
if (userInput === null) return;
const LIMIT = parseInt(userInput) || 0;
if (LIMIT <= 0) return;

const sleep = ms => new Promise(r => setTimeout(r, ms));
let deletedCount = 0;

console.log(Starting cleanup... Target: ${LIMIT} videos.);

while (deletedCount < LIMIT) {
/* 2. Scroll to ensure elements are loaded in the DOM */
window.scrollTo(0, document.documentElement.scrollHeight);
await sleep(2000);

const videos = document.querySelectorAll('ytd-playlist-video-renderer');
if (videos.length === 0) {
  console.log("No more videos found.");
  break;
}

for (const video of videos) {
  if (deletedCount >= LIMIT) break;

  /* 3. Find and click the three-dot menu button */
  const menuBtn = video.querySelector('#button[aria-label]');
  if (!menuBtn) continue;

  menuBtn.click();
  await sleep(500);

  /* 4. Find the 'Remove from Watch Later' button in the popup menu */
  const removeBtn = [...document.querySelectorAll('ytd-menu-service-item-renderer')]
    .find(el => el.innerText.toLowerCase().includes('remove from'));

  if (removeBtn) {
    removeBtn.click();
    deletedCount++;
    console.log(`Deleted ${deletedCount}/${LIMIT}`);
    /* Short delay to allow YouTube's UI to process the removal */
    await sleep(800);
  }
}

if (deletedCount >= LIMIT) break;


}

alert(Cleanup complete! Total videos removed: ${deletedCount});
})();

Step 2: How to Use

Navigate to your YouTube Watch Later Playlist.

Click the Clear Watch Later button on your bookmarks bar.

Enter the number of videos you want to purge.

Stay on the tab: The script simulates physical clicks. If you switch tabs, the browser may "throttle" the script, causing it to slow down or stop.

Important Platform Notes

🦊 LibreWolf / Firefox Users

LibreWolf has strict security settings. If the bookmarklet fails to trigger the popup:

Check your Console (F12). If you see a Content Security Policy (CSP) error, your browser is blocking "inline scripts."

Fix: You may need to use an extension like Tampermonkey to host the script, as extensions have higher execution privileges than bookmarks in hardened browsers.

🌐 Chrome / Chromium Users

Chrome has a specific security feature regarding the address bar:

The "javascript:" Strip: If you try to copy-paste the code directly into the URL bar, Chrome will automatically remove the javascript: prefix.

Fix: You must use the "Bookmark Manager" (Ctrl+Shift+O) to create the bookmark. Manually ensure the URL starts with javascript: without any spaces.

⚠️ Maintenance

YouTube changes its code frequently. If the script stops working, it is likely because YouTube renamed the menu button label. You will need to inspect the page and update the aria-label or the innerText filter in the script code.

Stay productive, and get to bed on time!