updated 2021-06-23
Version 2105 (Build 14026.20302)
==========================================
var callback = function(mutationsList, observer) { | |
for(let mutation of mutationsList) { | |
if (mutation.type === 'childList') { | |
mutation.addedNodes.forEach((node) => { | |
if(node instanceof Element && node.hasAttribute('href')) { | |
var href = node.getAttribute('href'); | |
if(href.match(/https\:\/\/www\.youtube\.com\/redirect\?.+/gm)) { | |
const urlParams = new URLSearchParams(href); | |
node.setAttribute('href', urlParams.get('q')); | |
} |