NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript==
// @name sorozat-barat.online reklám blokkoló
// @namespace https://openuserjs.org/users/komigabor/scripts
// @version 0.2
// @description Felugró reklámok (adfly) és más reklámok blokkolása a sorozatbarat.club oldalon
// @author komigabor
// @match https://www.sorozatbarat.club/episode/*
// @grant none
// @license MIT
// ==/UserScript==
(function() {
'use strict';
var regexp = /\/video\/redirect\/([^/]+)\/([^/]+)/i
function findAncestor(node, criteria)
{
while (node && !criteria(node))
{
node = node.parentElement;
}
return node;
}
function rewriteURL(aElem) {
// console.log(aElem);
var href = aElem.getAttribute('href'),
parts = href ? href.match(regexp) : false;
if (parts) {
var newHref = 'https://www.filmorias.com/ugras-a-videohoz/' + parts[1] + '/' + parts[2];
aElem.setAttribute('href', newHref);
//console.log('HREF rewriten ' + href + ' -> ' + newHref);
}
//else {
// console.log(' no need to rewrite' + href);
//}
}
var anchors = document.getElementsByTagName('a');
for (var a of anchors) {
rewriteURL(a);
}
document.getElementById('banner').remove();
var node;
var nodes = document.getElementsByTagName('ins');
for (node of nodes)
{
var row = findAncestor(node, n => n.nodeName == 'TR');
if(row) row.remove();
// else console.log(node, 'is not a node we are interested in');
}
node = document.getElementById('sorozatbarat.online_728x90_1_adsense');
node = findAncestor(node, n => n.nodeName == 'TR');
if (node) node.remove();
})();