Skip to content

Instantly share code, notes, and snippets.

@kemayo
Created July 25, 2016 16:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kemayo/220f626eaabdc56e519c22cb812607fe to your computer and use it in GitHub Desktop.
Save kemayo/220f626eaabdc56e519c22cb812607fe to your computer and use it in GitHub Desktop.
// ==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