NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @namespace https://openuserjs.org/users/nobdy // @exclude * // ==UserLibrary== // @name DomUtil // @description Dom operation utils // @copyright 2020, nobdy (https://openuserjs.org/users/nobdy) // @license MIT // @version 1.0 // @require https://openuserjs.org/src/libs/nobdy/LogUtil.js // ==/UserScript== // ==/UserLibrary== // ==OpenUserJS== // @author nobdy // ==/OpenUserJS== /* jshint esversion: 6 */ (function (global) { 'use strict'; function getElementByClassName(className) { const cs = document.getElementsByClassName(className) return cs && cs[0] } function hideElementByClassName(className) { const el = getElementByClassName(className) if (el && el.style.display !== 'none') { LogUtil.log(`hiding element with class name ${className}`) el.style.display = 'none' } } global.DomUtil = { getElementByClassName, hideElementByClassName }; })(top);