Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Lelombrik
- // @version 0.1.0
- // @grant none
- // @include https://lelombrik.net/*
- // ==/UserScript==
- (function() {
- 'use strict';
- function enhanceVideo(el) {
- el.setAttribute('controls', '');
- el.removeAttribute('loop');
- }
- const videoElements = document.getElementsByTagName('video');
- for (const el of videoElements) {
- enhanceVideo(el);
- }
- const observer = new MutationObserver(mutations => {
- for (const mutation of mutations) {
- for (const addedNode of mutation.addedNodes) {
- if (addedNode.nodeType === 1 && addedNode.tagName === 'VIDEO') {
- enhanceVideo(addedNode)
- }
- }
- }
- });
- observer.observe(document.body, { childList: true, subtree: true });
- })();
Add Comment
Please, Sign In to add comment