Created
July 25, 2016 16:35
-
-
Save kemayo/220f626eaabdc56e519c22cb812607fe to your computer and use it in GitHub Desktop.
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 Gerrit: Remove size from searchbox | |
// @namespace http://davidlynch.org/ | |
// @version 0.1 | |
// @description Searchbox too wide; removing its size attribute helps there | |
// @author David Lynch <kemayo@gmail.com> | |
// @match https://gerrit.wikimedia.org/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
var MutationObserver = window.MutationObserver || window.WebKitMutationObserver; | |
var observer = new MutationObserver(function(mutations, observer) { | |
var searchBox = document.querySelector('input.searchTextBox[size]'); | |
if (searchBox) { | |
searchBox.removeAttribute('size'); | |
} | |
}); | |
observer.observe(document, { | |
subtree: true, | |
childList: true, | |
attributes: false, | |
characterData: false | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment