Last active
August 30, 2016 16:22
-
-
Save Dither/3038423 to your computer and use it in GitHub Desktop.
AutoPatchWorkOpera support script for YouTube video search
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @include https://www.youtube.com/results* | |
// @description AutoPatchWork Mod 1.9.6+ support script for youtube video search | |
// ==/UserScript== | |
(function() { | |
function handleNewPage () { | |
var clip = document.querySelectorAll('img[data-thumb][alt="Thumbnail"]'); | |
[].forEach.call(clip, function (img) { | |
img.src = img.getAttribute('data-thumb').replace(/^\/\//, 'https://'); | |
img.removeAttribute('data-thumb'); | |
}); | |
} | |
document.addEventListener('AutoPatchWork.pageloaded', handleNewPage, false); | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment