Desidime Redirect Removal

Desidime Remove Tracking

目前為 2022-02-20 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name          Desidime Redirect Removal
// @version       1
// @run-at        document-start
// @description   Desidime Remove Tracking
// @include       https://www.desidime.com/*
// @author        MaskedWarrior
// @license MIT 
// @namespace https://greasyfork.org/users/878597
// ==/UserScript==

// Checks if page is loaded
document.onreadystatechange = () => {
	if (document.readyState === 'complete') {  
		// loads a href which DesiDime has added tracking
		qLinks = document.querySelectorAll("a[href*='links?ref']")
		// loops through each of the a href
		for (var J = qLinks.length - 1; J >= 0; --J) {
			// Get the URL compent (href)
			var oldHref = qLinks[J].getAttribute('href');
			// Get the OriginalURL
			var newHref1 = oldHref.split('&url=')[1];
			// Deocode the URl
			var newHref = decodeURIComponent(newHref1)
			// Change the links
			qLinks[J].setAttribute('href', newHref);
		}
	}
};