Last active
June 20, 2018 08:28
-
-
Save ZiTAL/c7c5c6be8f628c0ac820fdfe1a1b1296 to your computer and use it in GitHub Desktop.
javascript / greasemonkey / tampermonkey: RTVE en DIRECTO-ren bideoetan elementuak ezabatzeko script-a
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== | |
// @name RtveDirectoHide | |
// @namespace RtveDirectoHide | |
// @description Rtve Zuzeneko elementuak ezabatu | |
// @include http://www.rtve.es/directo/* | |
// @include https://www.rtve.es/directo/* | |
// @grant none | |
// @version 1 | |
// @license AGPL v3 | |
// @run-at document-idle | |
// ==/UserScript== | |
(function() | |
{ | |
'use strict'; | |
var inter; | |
var RtveDirectoHide = | |
{ | |
selectors : ['#replaceHead', '.col.c2', '.c1_listado', '.c1_intro'], | |
init : function() | |
{ | |
var self = this; | |
var elements = document.querySelectorAll(self.selectors); | |
var l = elements.length; | |
if (l > 0) | |
{ | |
for (var i = 0; i < l; i++) | |
{ | |
if (elements[i] !== null) | |
elements[i].parentNode.removeChild(elements[i]); | |
} | |
} | |
else | |
{ | |
window.clearInterval(inter); | |
inter = 0; | |
} | |
} | |
}; | |
if (inter === undefined) | |
{ | |
inter = window.setInterval(function() | |
{ | |
RtveDirectoHide.init(); | |
}, 1 * 1000); | |
} | |
})(); |
Author
ZiTAL
commented
Jun 20, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment