Skip to content

Instantly share code, notes, and snippets.

@hjdarnel
Last active October 17, 2025 17:04
Show Gist options
  • Select an option

  • Save hjdarnel/a4d5f24dc7917dc85a407a24386c99b1 to your computer and use it in GitHub Desktop.

Select an option

Save hjdarnel/a4d5f24dc7917dc85a407a24386c99b1 to your computer and use it in GitHub Desktop.
Add hotkeys to Letterboxd's film detail page, like W for toggle watchlist
// ==UserScript==
// @name Letterboxd Search Hotkey
// @namespace hjdarnel
// @version 0.0.3
// @description Press / anywhere on Letterboxd to search, W to toggle watchlist status
// @author Henry Darnell https://github.com/hjdarnel
// @include /^https:\/\/letterboxd\.com\/film\/[^\/]+\/$/
// @downloadURL https://gist.github.com/hjdarnel/a4d5f24dc7917dc85a407a24386c99b1/raw/letterboxd-film-hotkeys.user.js
// @updateURL https://gist.github.com/hjdarnel/a4d5f24dc7917dc85a407a24386c99b1/raw/letterboxd-film-hotkeys.user.js
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
// ==/UserScript==
"use strict";
const sleep = (ms) => new Promise((res) => setTimeout(res, ms));
document.addEventListener("keyup", async (event) => {
switch (event.code) {
case "KeyW": {
const removeEl = document.querySelector("a.remove-from-watchlist");
const addEl = document.querySelector("a.add-to-watchlist");
if (removeEl && !removeEl.parentElement.classList.contains("hidden")) {
removeEl.click();
} else if (addEl && !addEl.parentElement.classList.contains("hidden")) {
addEl.click();
}
break;
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment