Work Text:
Installing the userscript
- Install a browser that supports extensions
- Install the Tampermonkey extension
- Create a new script using the Tampermonkey menu
- Replace the new script template with the script below
- Save the script (Ctrl+S or there's a save button in the menu)
Using the userscript
- To add another tag replacement: you can see where the list is, add a line that goes something like
.replace('AO3 tag', 'Desired tag') - To remove tags: just remove the line that has the tag, no other edits are needed
- If you need to see original tag names, you can hover over them, disable the script or navigate to their pages (it doesn't replace the headers, only links)
The userscript
Click to uncover (it's a bit long)
// ==UserScript==
// @name [AO3] Declutter video creators' tags
// @version 0.4
// @description Removes video creators' real (or extra) names from tags
// @homepage https://www.ao3.icu/works/60422266
// @author napdragon
// @namespace https://www.ao3.icu/users/napdragon
// @tag AO3
// @icon https://www.ao3.icu/favicon.ico
// @match *://*.www.ao3.icu/*
// @match https://archiveofourown.gay/*
// @match https://archive.transformativeworks.org/*
// @grant none
// @run-at document-body
// ==/UserScript==
(function() {
declutter({
tags: document.querySelectorAll('a.tag')
})
const workFilters = document.querySelector('#work-filters')
if (workFilters) {
const tagsToDeclutter = workFilters.querySelectorAll('.tags span:not([class])')
declutter({
tags: tagsToDeclutter,
isFilter: true
})
}
function declutter(options) {
const { tags, isFilter } = options
for (let tag of tags) {
const oldTagText = tag.innerText
tag.title = oldTagText
const shipSeparator = /&/.test(oldTagText) ? ' & ' : '/'
if (isFilter) {
const workCount = / \(\d+\)$/.exec(oldTagText)[0]
const tagParts = oldTagText.slice(0, -workCount.length).split(shipSeparator)
tag.innerHTML = tagParts.map(part => removeRealNames(part).trim()).join(shipSeparator) + workCount
} else {
const tagParts = oldTagText.split(shipSeparator)
tag.innerHTML = tagParts.map(part => removeRealNames(part).trim()).join(shipSeparator)
}
}
}
function removeRealNames(tagText) {
return tagText
.replace('Charles | Grian', 'Grian')
.replace('Martyn Littlewood | InTheLittleWood', 'Martyn | InTheLittleWood')
.replace('Scott Major | Smajor1995', 'Scott | Smajor1995')
.replace('Steffen Mössner | Docm77', 'Docm77')
.replace('Oliver Brotherhood | Mumbo Jumbo', 'Mumbo Jumbo')
.replace('Ryan | GoodTimesWithScar', 'GoodTimesWithScar')
.replace('John Booko | BdoubleO100', 'BdoubleO100')
.replace('Kris | ZedaphPlays', 'ZedaphPlays')
.replace('Anthony Viviano | Bigbst4tz2', 'BigB')
.replace('Anthony | Bigbst4tz2', 'BigB')
.replace('Daniel M. | VintageBeef', 'VintageBeef')
.replace('Arek Lisowski | Keralis', 'Keralis')
.replace('Natalie Arnold | StressMonster101', 'StressMonster101')
.replace('Katy | FalseSymmetry', 'FalseSymmetry')
.replace('Viktor | Iskall85', 'Iskall85')
.replace('Jevin | iJevin', 'iJevin')
.replace('Pearl | PearlescentMoon', 'PearlescentMoon')
.replace('Joe Hills | joehillssays', 'Joe Hills')
}
})()
