Skip to content

Instantly share code, notes, and snippets.

@Dither
Last active August 30, 2016 16:22
Show Gist options
  • Save Dither/3038423 to your computer and use it in GitHub Desktop.
Save Dither/3038423 to your computer and use it in GitHub Desktop.
AutoPatchWorkOpera support script for YouTube video search
// ==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