AO3 Profile Fandom Hider

Hides fandoms you don't want to see in your description. Type in your username/fandom to use

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         AO3 Profile Fandom Hider
// @namespace    http://tampermonkey.net/
// @version      0.3
// @description  Hides fandoms you don't want to see in your description. Type in your username/fandom to use
// @author       exuvia
// @match        https://archiveofourown.org/users/*
// @icon         http://archiveofourown.org/favicon.ico
// @grant        none
// ==/UserScript==

(function() {

	//test on https://archiveofourown.org/users/astolat/ to see what this will look like

	let username = "astolat" // replace this username with your own
	let fandomname = "Supernatural" // replace this with the fandom you don't want

    if (window.location.href.includes("https://archiveofourown.org/users/" + username)){ //check if your username
		let fandoms = Array.from(document.getElementById("user-fandoms").getElementsByTagName("a"))
		fandoms.forEach(fandom => {
			if (fandom.innerText === fandomname) {	//iterate through and check if fandom name; if true, hide fandom
				fandom.parentElement.hidden = true
			}
		})
	}

})();