Skip to content

Instantly share code, notes, and snippets.

@Klaster1
Last active November 8, 2022 01:38
Show Gist options
  • Save Klaster1/fe30388fcda10873c0b4f147e770e651 to your computer and use it in GitHub Desktop.
Save Klaster1/fe30388fcda10873c0b4f147e770e651 to your computer and use it in GitHub Desktop.
MangaUpdates sane polls userscript
// ==UserScript==
// @name MangaUpdates sane polls
// @namespace Violentmonkey Scripts
// @author Klaster_1
// @version 1.0.0
// @match https://www.mangaupdates.com/*
// @description Wraps poll choices with labels
// @icon https://www.mangaupdates.com/favicon.ico
// @downloadURL https://gist.githubusercontent.com/Klaster1/fe30388fcda10873c0b4f147e770e651/raw/mu-sane-polls.user.js
// @updateURL https://gist.githubusercontent.com/Klaster1/fe30388fcda10873c0b4f147e770e651/raw/mu-sane-polls.user.js
// @grant none
// ==/UserScript==
document
.querySelectorAll("form[action='https://www.mangaupdates.com/poll.html'] tr:not(:nth-child(1)):not([valign])")
.forEach((choice, index) => {
const radio = choice.querySelector('input')
const value = choice.querySelector('[width="90%"]')
const id = `choice_${index}`
radio.id = id
value.innerHTML = `<label for="${id}">${value.textContent}</label>`
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment