Work Text:
Installing the userscript
- Install a browser that supports extensions
- Install either the Violentmonkey or Tampermonkey extension (Violentmonkey is open-source while Tampermonkey is more popular. Violentmonkey might not be supported in some browsers - see this issue on GitHub)
- Create a new script using the extension's 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.7
// @description Removes video creators' real (or extra) names from tags
// @homepageURL https://archiveofourown.org/works/60422266
// @author napdragon
// @namespace https://archiveofourown.org/users/napdragon
// @icon https://archiveofourown.org/favicon.ico
// @match https://archiveofourown.org/*
// @match *://insecure.archiveofourown.org/*
// @match https://archiveofourown.gay/*
// @match https://archive.transformativeworks.org/*
// @grant none
// @tag AO3
// ==/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
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)
}
if (tag.innerText !== oldTagText) {
tag.title = oldTagText
}
}
}
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')
}
})()
