Skip to content

Commit 56360ad

Browse files
autotail-codepipeline-logs.user.js
1 parent df0e2b4 commit 56360ad

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// ==UserScript==
2+
// @name Auto-Tail CodePipeline Logs
3+
// @namespace http://softwareengineerprogrammer.github.io
4+
// @version 0.1
5+
// @description un-papercut tail logs
6+
// @author softwareengineerprogrammer
7+
// @match https://*.console.aws.amazon.com/codesuite/codepipeline/pipelines/*/debug*
8+
// @grant none
9+
// @updateURL https://softwareengineerprogrammer.github.io/userscripts/autotail-codepipeline-logs.user.js
10+
// @downloadURL https://softwareengineerprogrammer.github.io/userscripts/autotail-codepipeline-logs.user.js
11+
// ==/UserScript==
12+
13+
(function () {
14+
'use strict';
15+
16+
let maxTries = 10;
17+
let loop = function (tries) {
18+
let elt = document.querySelector('.dx-LogTab__header > awsui-button:nth-child(2) > button:nth-child(1) > span:nth-child(1)');
19+
if (elt) {
20+
console.debug('Found Tail Logs button...');
21+
22+
setTimeout(function () {
23+
elt.click();
24+
console.debug('Clicked Tail Logs button.');
25+
}, 1000);
26+
} else if (tries < maxTries) {
27+
console.debug('Didn\'t find Tail Logs button, will try again...');
28+
setTimeout(function () {
29+
loop(tries + 1);
30+
}, 250);
31+
} else {
32+
console.debug('Giving up trying to click Tail Logs button');
33+
}
34+
};
35+
36+
loop(0);
37+
})();

0 commit comments

Comments
 (0)