API for CustomElements in YouTube

A JavaScript tool to modify CustomElements in YouTube

Από την 09/05/2023. Δείτε την τελευταία έκδοση.

Αυτός ο κώδικας δεν πρέπει να εγκατασταθεί άμεσα. Είναι μια βιβλιοθήκη για άλλους κώδικες που περιλαμβάνεται μέσω της οδηγίας meta // @require https://update.greasyforks.org/scripts/465819/1187694/API%20for%20CustomElements%20in%20YouTube.js

Δημιουργός
𝖢𝖸 𝖥𝗎𝗇𝗀
Έκδοση
1.0
Δημιουργήθηκε την
09/05/2023
Ενημερώθηκε την
09/05/2023
Μέγεθος
6 KB
Άδεια
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;
  });

})();
长期地址
遇到问题?请前往 GitHub 提 Issues。