Last active
April 25, 2022 09:13
-
-
Save amsv01/bf2dbb6b5da0934d0065ab5c909ddc2f to your computer and use it in GitHub Desktop.
Expand all nested Splunk result objects
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 Splunk expands | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @include *://*.domain.se/* | |
// @include *://domain.com/* | |
// @include https://domain.se/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
function autoExpand(){ | |
var found = false; | |
$(document).ready(function() { | |
$(".jsexpands").each(function() { | |
if($(this).html() == '[+]') { | |
found=true; | |
$(this)[0].click(); | |
} | |
}); | |
}); | |
if (found) { | |
setTimeout(function(){ | |
$('.modalize-table-overlay').click(); | |
}, 500); | |
} | |
} | |
// select the target node | |
var target = document.body; | |
// create an observer instance | |
var observer = new MutationObserver(function(mutations) { | |
autoExpand(); | |
}); | |
// configuration of the observer: | |
var config = { attributes: true, childList: true, characterData: true, subtree:true}; | |
// pass in the target node, as well as the observer options | |
observer.observe(target, config); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment