Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
View CI Images
// ==UserScript==
// @name View CI Images
// @namespace
// @description View CI Images
// @version 1
// @match https://gitlabci/projects/*/builds/*
// ==/UserScript==
(function ($) {
var text = $('#build-trace').html();
/* HACKY: we can't consume any of the buffer else we can't replace
* the next image */
text = text.replace(/(Test_.+\.png)\n([A-Za-z0-9\n\/\+=]+)\nEOF\n/g,
'<h2>$1</h2><img src="data:image/png;base64,$2" ' +
'style="display:block; max-width:800px; width: auto; height: auto;" ' +
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment