Remove ad for Reader Mode Pro in ReaderMode extension

Removes bottom right block advertising "Reader Mode Pro", the paid version of readermode.io

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Remove ad for Reader Mode Pro in ReaderMode extension
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Removes bottom right block advertising "Reader Mode Pro", the paid version of readermode.io
// @author       https://greasyfork.org/en/users/728793-keyboard-shortcuts
// @match        https://*/*
// @match        http://*/*
// @icon         https://lh3.googleusercontent.com/enMBRM7MzaKfxzyEJpzH9KIlyxcs0T2kkqteBVvTF1ti1ESTgBb4Ox818fqhUM86J0JaNktU6wFvMSSUf9JhAwPWKg=w256-h256-e365-rj-sc0x00ffffff
// @grant        none
// @license      MIT
// ==/UserScript==

/* jshint esversion: 6 */
(function() {
    // Written by a Reader Mode user who's annoyed enough at the constant advertising to write a script to remove it.

    'use strict';

    var readerProTimer = null;
    readerProTimer = setInterval(function() {
        const ids = ['cr-pro-features-modal', 'cr-pro-features-tooltip'];
        const iframes = Array.from(document.getElementsByTagName('iframe')).filter(iframe => iframe.contentDocument);
        for (var iframe of iframes) {
            for (var id of ids) {
                const el = iframe.contentDocument.getElementById(id); // Reader Mode creates an iframe, so we have to look for this element in there.
                if (el) {
                    el.remove();
                    clearInterval(readerProTimer);
                }
            }
        }
    }, 1000);
})();