Schlandhut

Ersetzt das rote X (Deppenkreuz) durch einen Schlandhut. Nur auf TWITTER DOT COM.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name     Schlandhut
// @version  1.5
// @grant    none
// @description Ersetzt das rote X (Deppenkreuz) durch einen Schlandhut. Nur auf TWITTER DOT COM.
// @include http://twitter.com/*
// @include http://*.twitter.com/*
// @include https://twitter.com/*
// @include https://*.twitter.com/*
// @namespace https://greasyfork.org/users/207156
// ==/UserScript==

function escapeRegExp(str) {
  return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string
}

String.prototype.replaceAll = function(search, replacement) {
    var target = this;
    return target.replace(new RegExp(search, 'g'), replacement);
};

search = escapeRegExp('https://abs.twimg.com/emoji/v2/72x72/274c.png');
replace = escapeRegExp('https://pbs.twimg.com/media/DlT_Ky4XgAYjsej.png');

document.body.innerHTML = document.body.innerHTML.replaceAll(search,replace);