Last active
June 8, 2020 23:31
-
-
Save theY4Kman/9938a82b2176aa4ef3fb38fec564500c to your computer and use it in GitHub Desktop.
Link instance IDs on Beanstalk's Health page to the EC2 Console
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 Linkify beanstalk instances | |
// @namespace https://perchsecurity.com | |
// @updateURL https://gist.githubusercontent.com/theY4Kman/9938a82b2176aa4ef3fb38fec564500c/raw/beanstalk-instance-linker.tamper.js | |
// @version 1.0 | |
// @description Link instance IDs to EC2 console in Beanstalk | |
// @author theY4Kman | |
// @match https://console.aws.amazon.com/elasticbeanstalk/* | |
// @match https://*.console.aws.amazon.com/elasticbeanstalk/* | |
// @grant none | |
// ==/UserScript== | |
$(function() { | |
'use strict'; | |
$('body').on('mouseup', '[ng-click*="instancePopover"]', function(e) { | |
const instanceId = $(this).text().trim(); | |
const href = `https://console.aws.amazon.com/ec2/v2/home?region=us-east-1#Instances:instanceId=${instanceId};sort=instanceId`; | |
const link = $('<a>').attr('href', href).hide().appendTo(this); | |
link.on('click', function() { $(this).remove() }); | |
link[0].dispatchEvent(new MouseEvent('click', { button: e.button, which: e.which })); | |
e.preventDefault(); | |
return false; | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment