Remove Share Buttons

Remove useless "trainer wheels" tracking buttons.

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

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

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

作者のサイトでサポートを受ける。または、このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==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();