Skip to content

Instantly share code, notes, and snippets.

@dploeger
Last active June 16, 2020 09:41
Show Gist options
  • Save dploeger/30d5c0e3bed70b1fbb06a45a6d7a6ced to your computer and use it in GitHub Desktop.
Save dploeger/30d5c0e3bed70b1fbb06a45a6d7a6ced to your computer and use it in GitHub Desktop.
Tampermonkey script to automatically login into Foreman
// ==UserScript==
// @name Foreman Autologin
// @namespace https://kps.com/
// @version 0.2
// @description Automatically login into Foreman
// @author Dennis Ploeger <dennis.ploeger@kps.com>
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js
// @grant none
// @downloadUrl https://gist.github.com/dploeger/30d5c0e3bed70b1fbb06a45a6d7a6ced/raw
// @updateUrl https://gist.github.com/dploeger/30d5c0e3bed70b1fbb06a45a6d7a6ced/raw
// ==/UserScript==
(function() {
'use strict';
const login = () => {
if ($('#login_login').length == 0) {
window.setTimeout(login,1000)
return
}
$('form').submit()
}
window.setTimeout(login, 1000)
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment