Skip to content

Instantly share code, notes, and snippets.

@morinted
Created June 22, 2017 15:16
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save morinted/142e92359f0522c1761c8e3d58cb027a to your computer and use it in GitHub Desktop.
Save morinted/142e92359f0522c1761c8e3d58cb027a to your computer and use it in GitHub Desktop.
Remove TypeRacer Input limit

This script removes the input length limit which can trip up Plover users.

Simply install the script into TamperMonkey (Chrome) or GreaseMonkey (Firefox) and get racing.

The script was created by community member nimble

// ==UserScript==
// @name Typeracer - No input limit
// @namespace http://opensteno.org/
// @version 0.2
// @description no more TypeRacer length limit
// @author nimble
// @match http://play.typeracer.com/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
var inputBox = document.getElementsByClassName("txtInput");
var maxLengthObserver = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
mutation.target.removeAttribute("maxlength");
});
});
new MutationObserver(function(mutations) {
for(var node of inputBox)
maxLengthObserver.observe(node, { attributes: true, attributeList: ["maxlength"] });
}).observe(document.body, {
childList: true,
subTree: true,
});
})();
@user202729
Copy link

subTree should be subtree. JavaScript is case-sensitive. (however the current script still works because it isn't necessary to listen for subtree changes)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment