Skip to content

Instantly share code, notes, and snippets.

@werrpy
Created June 5, 2019 01:43
Show Gist options
  • Save werrpy/7061ea1670072cf3f615d3057a29979a to your computer and use it in GitHub Desktop.
Save werrpy/7061ea1670072cf3f615d3057a29979a to your computer and use it in GitHub Desktop.
UNIT3D fix spoilers
// ==UserScript==
// @name UNIT3D Fix Spoiler
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @grant none
// ==/UserScript==
(function() {
'use strict';
function toggleSpoiler(element) {
if (element.style.display === '') {
element.style.display = 'none';
} else {
element.style.display = '';
}
}
var spoilerButtons = document.querySelectorAll(".decoda-spoiler-button");
spoilerButtons.forEach(function(element) {
element.onclick = function() {
toggleSpoiler(this.nextElementSibling);
};
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment