MCPcopy
hub / github.com/ChinaGodMan/UserScripts / removeCSS

Function removeCSS

youtube-dynamic-grid/youtube-dynamic-grid.user.js:535–548  ·  view source on GitHub ↗

* Removes the CSS style element and resets grid attributes.

()

Source from the content-addressed store, hash-verified

533 * Removes the CSS style element and resets grid attributes.
534 */
535 removeCSS() {
536 const style = document.getElementById('dynamic-grid-style')
537 if (style) {
538 style.remove()
539 logger('Removed CSS style element', 'debug')
540 }
541 const grid = document.querySelector('ytd-rich-grid-renderer')
542 if (grid) {
543 grid.removeAttribute('elements-per-row')
544 grid.style.removeProperty('--ytd-rich-grid-items-per-row')
545 grid.style.removeProperty('--ytd-rich-grid-posts-per-row')
546 logger('Reset grid attributes', 'debug')
547 }
548 },
549
550 /**
551 * Attempts to update the grid with retries.

Callers

nothing calls this directly

Calls 1

loggerFunction · 0.85

Tested by

no test coverage detected