Last active
November 17, 2022 17:24
-
-
Save derqurps/f65fac33c624bed746353fe56f2e2339 to your computer and use it in GitHub Desktop.
automatically enter your default stopwords on redactle-unlimited.com
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name redactle stopwords | |
// @namespace http://tampermonkey.net/ | |
// @version 0.2 | |
// @description automatically enter your default stopwords on redactle-unlimited.com | |
// @author You | |
// @match https://redactle-unlimited.com | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
window.addEventListener('load', function() { | |
setTimeout(()=>{ | |
const settings = document.getElementById('btn-settings'); | |
const innerSpan = settings.querySelector('.desc'); | |
const buttonEl = document.createElement("a"); | |
const newInnerSpan = document.createElement("span"); | |
const inclass = innerSpan.className.split(' ') | |
inclass.forEach((classname)=> { | |
newInnerSpan.classList.add(classname) | |
}); | |
newInnerSpan.innerHTML = 'Add stopwords'; | |
const outclass = settings.className.split(' ') | |
outclass.forEach((classname)=> { | |
buttonEl.classList.add(classname) | |
}); | |
buttonEl.addEventListener("click", testStopwords); | |
buttonEl.appendChild(newInnerSpan); | |
settings.after(buttonEl); | |
},2000); | |
}, false); | |
let list=[ | |
'your', | |
'stopwords', | |
'go', | |
'here' | |
]; | |
function testStopwords() { | |
const inp = document.getElementById("input-guess") | |
inp.focus(); | |
for(let item of list) { | |
inp.value = item; | |
inp.dispatchEvent(new Event('input')); | |
document.querySelector('#submit').click() | |
} | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment