Created
July 14, 2017 08:05
-
-
Save akmandev/934d76a0016f5e482ac31aa70e04804f to your computer and use it in GitHub Desktop.
This file contains hidden or 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 Hide Warnings in Request Log Window | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @include */Sites-Site/-/ViewLogConsole-Start | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
function contains(selector, text) { | |
var elements = document.querySelectorAll(selector); | |
return [].filter.call(elements, function(element){ | |
return RegExp(text).test(element.textContent); | |
}); | |
} | |
function hideAll (elements){ | |
for (var i=0; i < elements.length; i++) { | |
elements[i].setAttribute('style', 'display:none'); | |
} | |
} | |
var checkWarnings = setInterval(function(){ | |
var elements = contains('.x-grid3-row', 'WARN'); | |
if(elements.length > 0){ | |
hideAll(elements); | |
clearInterval(checkWarnings); | |
} | |
}, 300); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment