Skip to content

Instantly share code, notes, and snippets.

@jkubacki
Last active August 29, 2015 14:08
Show Gist options
  • Save jkubacki/f6e65bfc486439a61c17 to your computer and use it in GitHub Desktop.
Save jkubacki/f6e65bfc486439a61c17 to your computer and use it in GitHub Desktop.
Tampermonkey nms
// ==UserScript==
// @name Nms account highlighter
// @namespace http://e-price.com.pl
// @version 1.0
// @description Set background color for allegro nms account.
// @author Jakub Kubacki
// @match http://ms.allegro.pl/*
// @grant none
// ==/UserScript==
var logoutElement = document.getElementById("user-logout");
if (logoutElement) {
var buttonContent = logoutElement.previousSibling.previousSibling.innerHTML;
var accountName = buttonContent.replace('<strong>Zalogowany: </strong> ', '');
var color = 'white';
switch(accountName) {
case 'kostiumowo_pl':
color = '#FFBAF9';
break;
case 'twojestroje_pl':
color = '#D4E3E5';
break;
case 'talerze24_pl':
color = '#E2D0AE';
break;
default:
color = 'white';
break;
}
document.body.style.backgroundColor = color;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment