Rulu.co remove ads

Removes ad links from Rulu.co

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Rulu.co remove ads
// @namespace    https://greasyfork.org/users/649
// @version      1.0.6
// @description  Removes ad links from Rulu.co
// @author       Adrien Pyke
// @match        *://www.rulu.co/*
// @require      https://cdn.jsdelivr.net/gh/fuzetsu/userscripts@ec863aa92cea78a20431f92e80ac0e93262136df/wait-for-elements/wait-for-elements.js
// @grant        none
// ==/UserScript==

(() => {
  'use strict';

  const Util = {
    qq(query, context = document) {
      return Array.from(context.querySelectorAll(query));
    }
  };

  const REGEX = /^https?:\/\/rulu\.io\/j\//iu;

  Util.qq('a')
    .filter(link => link.href.match(REGEX))
    .forEach(link => (link.href = link.href.replace(REGEX, '')));

  waitForElems({
    sel: '#d0bf',
    onmatch(overlay) {
      overlay.remove();
    }
  });
})();