API for CustomElements in YouTube

A JavaScript tool to modify CustomElements in YouTube

Version vom 09.05.2023. Aktuellste Version

Dieses Skript sollte nicht direkt installiert werden. Es handelt sich hier um eine Bibliothek für andere Skripte, welche über folgenden Befehl in den Metadaten eines Skriptes eingebunden wird // @require https://update.greatest.deepsurf.us/scripts/465819/1187694/API%20for%20CustomElements%20in%20YouTube.js

Autor
𝖢𝖸 𝖥𝗎𝗇𝗀
Version
1.0
Erstellt am
09.05.2023
Letzte Aktualisierung
09.05.2023
Größe
6,42 KB
Lizenz
MIT

Example:

// ==UserScript==
// @name         Testing
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        https://www.youtube.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=youtube.com
// @grant        none
// @run-at       document-start
// @require      <<TBC>>
// ==/UserScript==

(function () {
  'use strict';

  console.log('script started');
  customYtElements.whenRegistered('ytd-rich-grid-renderer', (proto) => {
    console.log('yt element is registered', proto.is);
    proto.calcElementsPerRow = () => 5;
  });

})();