Skip to content

Instantly share code, notes, and snippets.

@jake9000
Last active July 17, 2023 15:55
Show Gist options
  • Save jake9000/146b9a65e3a98b69649bfa0d8099dcfd to your computer and use it in GitHub Desktop.
Save jake9000/146b9a65e3a98b69649bfa0d8099dcfd to your computer and use it in GitHub Desktop.
Secret Server Include Subfolders Always
// ==UserScript==
// @name Secret Server Include Subfolders Always
// @namespace http://tampermonkey.net/
// @version 0.1.1
// @description Select 'include subfolders' every time you load a folder.
// @author https://github.com/jake9000
// @match *://your.secretserver.url.here/*
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
// @run-at document-start
// For Delinea Version: 11.3.000003
// It automatically toggles from 'current folder' to 'include subfolders view in secret server.
// In order to use this, you need a userscript manager like Tampermonkey or Greasemonkey.
// you MUST put your url on line 7.
// delinea devs, put a feedback form directly in the app you cowards
//
// https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo
// https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/
// ==/UserScript==
(function() {
'use strict';
setInterval(function() {
// detects if the button needs to be clicked
// tries every 5 seconds
// this is kind of bad but secretserver seems to resist event listeners.
const container = document.getElementById('subfolder-filter-button');
if (container.textContent.includes('Current Folder')) { // only do stuff if not already showing subfolders
console.log("trying to click buttons");
var tbc = document.getElementById("subfolder-filter-button");
tbc.click();
var tb = document.getElementById("include-subfolders");
tb.click();
// return cursor to searchbox
var searchbox = document.getElementById("filter-grid-header-search");
searchbox.select();
} else {}
}, 4000);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment