Greasy Fork is available in English.

Youtube Save To Playlist Hotkey And Filter

Adds a P hotkey to Youtube, to bring up the Save to Playlist dialog. Playlists will be displayed alfabetically sorted, any any playlist the current video belongs to, will be shown at the top. Also adds a focuced filter input field. If nothing is written into the filter input, all playlists will be shown, alternatively only the playlists where the name containes the sequence of letters typed in the input field, will be displayed. Press escape to exit the dialog.

< Valutazione su Youtube Save To Playlist Hotkey And Filter

Recensione: OK - lo script funziona, ma ha degli errori.

§
Pubblicato: 11/01/2025

Hi,
You should ignore P when in edition mode. Here is how to do it.

// Listen for the 'p' key at the document level
document.addEventListener('keydown', evt => {
// Avoid capturing if user holds Ctrl/Alt/Meta, or if in a text field, etc.
const activeElement = document.activeElement;
const isTextInput = activeElement.tagName === 'INPUT' || activeElement.tagName === 'TEXTAREA' || activeElement.isContentEditable;

if (evt.key === 'p' && !evt.ctrlKey && !evt.altKey && !evt.metaKey && !isTextInput) {
// Prevent YouTube from interpreting 'p' in any other way
evt.preventDefault();
evt.stopPropagation();

// Attempt to open the "Save to playlist" dialog
openSaveToPlaylistDialog();
}
}, true);

Pubblica risposta

Accedi per pubblicare una risposta.