Skip to content

Instantly share code, notes, and snippets.

@thebozzcl
Created July 27, 2022 23:10
Show Gist options
  • Save thebozzcl/e2d150e75c81f69a7e6d904b932f6171 to your computer and use it in GitHub Desktop.
Save thebozzcl/e2d150e75c81f69a7e6d904b932f6171 to your computer and use it in GitHub Desktop.
De-crapify Invidious by removing caps and emojis from titles
// ==UserScript==
// @name De-crapify Invidious
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Remove thumbnails and make titles lowercase
// @author TheBozzCL
// @match https://your.invidious.domain/*
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
// ==/UserScript==
(function() {
'use strict';
let cards = document.querySelectorAll('a[href^="/watch?"], a[href^="/playlist?"]');
cards.forEach(card => {
/*let thumbnail = card.querySelector(".thumbnail");
if (thumbnail != null) {
thumbnail.remove();
}*/
let title = card.querySelector("p");
if (title != null) {
title.textContent = title.textContent.toLowerCase().replace(/[^\p{L}\p{N}\p{P}\p{Z}^$\n]/gu, '');
};
});
let titles = document.querySelectorAll("h1, h2, h3");
titles.forEach(title => {
title.textContent = title.textContent.toLowerCase().replace(/[^\p{L}\p{N}\p{P}\p{Z}^$\n]/gu, '');
});
let title = document.querySelector('title');
if (title != null) {
title.textContent = title.textContent.toLowerCase().replace(/[^\p{L}\p{N}\p{P}\p{Z}^$\n]/gu, '');
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment