Skip to content

Instantly share code, notes, and snippets.

@oliverschloebe
Created September 2, 2017 20:03
Show Gist options
  • Save oliverschloebe/e49ef0d7374f9a2dbea42e2f8e5964b2 to your computer and use it in GitHub Desktop.
Save oliverschloebe/e49ef0d7374f9a2dbea42e2f8e5964b2 to your computer and use it in GitHub Desktop.
Verflixxte Klixx: Verflixxter Views Viewer
// ==UserScript==
// @name Verflixxte Klixx: Verflixxter Views Viewer
// @namespace https://www.rocketbeans.tv/
// @version 1.0
// @description Zeigt die Views von YT-Videos nur bei Hover.
// @author cyberblitzbirne
// @include http://*youtube.com/watch*
// @include https://*youtube.com/watch*
// @require https://code.jquery.com/jquery-3.2.1.slim.min.js
// @require https://gist.githubusercontent.com/BrockA/2625891/raw/waitForKeyElements.js
// ==/UserScript==
(function() {
'use strict';
var vkTextReplacement = '*trommelwirbel*';
var ytApp = document.querySelectorAll('body');
Array.prototype.forEach.call(ytApp, function(el, i) {
el.style.display = 'none';
});
function vkRbtvCallback(el) {
el.attr('data-vk-views', el.text()).attr('title', el.text());
el.on('mouseover', function() {
el.css('cursor', 'help').text(el.attr('data-vk-views'));
});
el.on('mouseout', function(e) {
el.css('cursor', 'auto').text(vkTextReplacement);
});
el.text(vkTextReplacement);
var ytApp = document.querySelectorAll('body');
Array.prototype.forEach.call(ytApp, function(el, i) {
if( el.style.display !== '' ) {
el.style.display = '';
}
});
}
waitForKeyElements('span.yt-view-count-renderer', vkRbtvCallback);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment