Skip to content

Instantly share code, notes, and snippets.

@431824
Created October 19, 2020 20:51
Show Gist options
  • Save 431824/1f291a12e578f6eac1e68ae81d76de9b to your computer and use it in GitHub Desktop.
Save 431824/1f291a12e578f6eac1e68ae81d76de9b to your computer and use it in GitHub Desktop.
Delete ads on fishki.net for tampermonkey
// ==UserScript==
// @name DeleteAdsOnFishki.net
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://fishki.net/
// @run-at document-idle
// @grant none
// @require https://code.jquery.com/jquery-3.4.1.min.js
// ==/UserScript==
(function() {
'use strict';
// Your code here...
var slides = document.getElementsByClassName("drag_element");
for (var i = 0; i < slides.length; i++) {
// console.log(window.performance.now() +":::"+slides.item(i).childNodes.length);
NodeList.prototype.forEach = Array.prototype.forEach
var children = slides.item(i).childNodes;
children.forEach(function(item){
if (typeof item.innerHTML !== "undefined"){
const author = item.querySelector('meta[itemprop=author]');
if (author != null){
const cnt = author.getAttribute('content');
// console.log(cnt);
if(cnt.indexOf("Реклама")>-1 || cnt.indexOf("RealFishki")>-1){
item.remove();
}
}
}
});
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment