Skip to content

Instantly share code, notes, and snippets.

list = document.querySelector('#contents').querySelector('#contents').querySelector('#contents');
function openMenu() {
list.firstChild.querySelector('#menu').querySelector('button').click()
}
function findRemoveEl() {
const items = [...document.querySelector('tp-yt-paper-listbox#items').querySelectorAll('yt-formatted-string')];
return items.find(i => i.textContent.includes('Remove from Watch Later'));
}
// rewrite-path-aliases.ts
// Usage:
// npx tsx rewrite-path-aliases.ts # dry run
// npx tsx rewrite-path-aliases.ts --write # apply edits
// Options:
// --extensions keep # keep file extensions in imports (default: strip)
// --root <dir> # project root (defaults to nearest tsconfig.json)
import fs from "node:fs";
import path from "node:path";