Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
// ==UserScript==
// @name Correct VA ages
// @namespace http://motemen.github.io/
// @description Correct VA ages to 17
// @match *://www.google.com/search*
// @match *://www.google.co.jp/search*
// ==/UserScript==
var answer = document.querySelector('.answers .answer_predicate');
var knop = document.querySelector('#knop');
var m;
if (answer && knop && (m = answer.innerText.match(/^(\d+)歳/)) && m[1] > 17 && /声優/.exec(knop.innerHTML)) {
var correctAnswer = answer.innerText.replace(/^(\d+)歳/, '17歳');
while (answer.firstChild) answer.removeChild(answer.firstChild);
answer.appendChild(document.createTextNode(correctAnswer));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment