Remove Share Buttons

Remove useless "trainer wheels" tracking buttons.

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

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 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        Remove Share Buttons
// @namespace   i2p.schimon.remove-share-buttons
// @description Remove useless "trainer wheels" tracking buttons.
// @homepageURL https://openuserjs.org/scripts/sjehuda/Remove_Share_Buttons
// @supportURL  https://openuserjs.org/scripts/sjehuda/Remove_Share_Buttons/issues
// @copyright   2024, Schimon Jehudah (http://schimon.i2p)
// @license     MIT; https://opensource.org/licenses/MIT
// @grant       none
// @run-at      document-end
// @match       file:///*
// @match       *://*/*
// @version     24.01.23
// @icon        data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAgMTAwIj48dGV4dCB5PSIuOWVtIiBmb250LXNpemU9IjkwIj7wn6qk77iPPC90ZXh0Pjwvc3ZnPgo=
// ==/UserScript==

var cssSelectors;

cssSelectors = [
  '/submit?url=',
  '/sharer.php?u=',
  '/intent/tweet?text=',
  '/pin/create/button/?url=',
  '://send?text=',
  '/pin/create/button?url=',
  '/sharing/share-offsite/?url=',
  '/mail/?view=',
  '/sharer/sharer.php?u=',
  '/share?url=',
  'app.com/send?text=',
  'gab.com/compose?url=',
  'n.com/shareArticle?',
  'r.com/share',
  'x.com/share',
  'wp.me/',
  ];

for (const cssSelector of cssSelectors) {
  let links = document.querySelectorAll('a[href*="' + cssSelector + '"]');
  for (const link of links) {
    link.remove();
  }
}

cssSelectors = [
  '/plugins/like.php?href=',
  ];

for (const cssSelector of cssSelectors) {
  let links = document.querySelectorAll('iframe[src*="' + cssSelector + '"]');
  for (const link of links) {
    link.remove();
  }
}

switch (location.hostname) {
  case "creation.com":
    cssSelectors = ".share-bar";
    break;
  case "notthebee.com":
    cssSelectors = ".article-shareables";
    break;
}

document.querySelector(cssSelectors).remove();