Mandiner comments' URL fixer

Userscript for fixing URLs in mandiner.hu's comments

スクリプトをインストールするには、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 Mandiner comments' URL fixer
// @name:hu Mandiner hozzászólás URL-javító
// @description	Userscript for fixing URLs in mandiner.hu's comments
// @description:hu	Felhasználói szkript a mandiner.hu hozzászólásaiban található URL-ek kijavításaira
// @icon	https://mandiner.hu/images/favicon.png
// @version	1.2
// @include	https://*mandiner.hu/cikk/*
// @include	https://*mandiner.hu/felhasznalo/*
// @grant   none
// @namespace https://greatest.deepsurf.us/users/412587
// ==/UserScript==

let actualURL = window.location.href,
	actualURLRegex = /https:\/\/(.*)mandiner.hu\/cikk\/(\d{6})\d{2}(.*)/,
	actualURLYearMonth = actualURL.replace(actualURLRegex,'$2'),
	commentURLs = document.querySelectorAll('.comment .text a'),
	commentURLRegex = new RegExp ('[\?&]utm_source=mandiner&utm_medium=link&utm_campaign=mandiner_' + actualURLYearMonth, 'gi');
for (let commentURL of commentURLs) {
	commentURL.setAttribute('href', commentURL.getAttribute('href').replace(commentURLRegex, ''));
}