Skip to content

Instantly share code, notes, and snippets.

@mohno007
Last active June 17, 2019 05:17
Show Gist options
  • Save mohno007/4532f9f342cc75480fc86064ba34172b to your computer and use it in GitHub Desktop.
Save mohno007/4532f9f342cc75480fc86064ba34172b to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name CodeBuild Highlight
// @namespace https://gist.github.com/mohno007/4532f9f342cc75480fc86064ba34172b
// @version 0.2
// @description Codebuild Highlight
// @author mohno007
// @match https://*.console.aws.amazon.com/codesuite/codebuild/projects/*
// @grant none
// @licence CC0 1.0
// @updateURL https://gist.githubusercontent.com/mohno007/4532f9f342cc75480fc86064ba34172b/raw/codebuild_highlight.user.js
// @downloadURL https://gist.githubusercontent.com/mohno007/4532f9f342cc75480fc86064ba34172b/raw/codebuild_highlight.user.js
// ==/UserScript==
(function() {
'use strict';
const styles = [
[/\[success\]/, { color: '#32cd32' }],
[/\[warn\]/, { color: '#ffa500' }],
[/\[error\]/, { color: '#f14949' }],
];
setInterval(() => {
const lines = [...document.querySelectorAll('.ace_line')];
lines.forEach(line => {
styles.forEach(([regex, style]) => {
if (regex.test(line.textContent)) {
Object.assign(line.style, style);
}
});
});
}, 5000);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment