Skip to content

Instantly share code, notes, and snippets.

@adamchainz
Created December 15, 2014 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamchainz/5ba26a1bb93fe78a6d9c to your computer and use it in GitHub Desktop.
Save adamchainz/5ba26a1bb93fe78a6d9c to your computer and use it in GitHub Desktop.
Highlight 'messages' text on logentries
// ==UserScript==
// @name Highlight 'messages' text on logentries
// @namespace http://adamj.eu/
// @version 0.1
// @author me@adamj.eu
// @match https://logentries.com/app/*
// @grant none
// ==/UserScript==
var highlightMessageKey = function () {
$('.highlighted-key[data-query=\'"message"\']').each(function () {
var $this = $(this);
var contents = $this.parent().contents();
var text = contents[contents.index(this) + 1];
// If it be a DOM Text node, embolden its stripped contents
if (text instanceof Text) {
$this.after('<strong>' + text.data.replace(/\\n/g, "<br>") + '</strong>');
text.remove();
}
});
};
setInterval(highlightMessageKey, 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment