-
-
Save neoOpus/e444668a204dffafe534b568923cabff to your computer and use it in GitHub Desktop.
Case Insensitive Radio Button Autofiller
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 Case Insensitive Label-based Radio Button Autofill ("Xabc Yhjk") | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match https://*.qualtrics.com/* | |
// @match https://*.surveymonkey.com/* | |
// @match https://*.surveygizmo.com/* | |
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js | |
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js | |
// @grant GM_addStyle | |
// ==/UserScript== | |
const findAndClickParent = text => { | |
const lowerText = text.toLowerCase(); | |
[...document.querySelectorAll('label > span')] | |
.forEach((e) => { | |
if (e.textContent.toLowerCase() === lowerText) { | |
e.parentElement.click(); | |
} | |
}); | |
} | |
waitForKeyElements( | |
"label", | |
() => { | |
findAndClickParent("Xabc Yhjk"); | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment