Plint change header between testing and production

Plint header color based on development

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

You will need to install an extension such as Tampermonkey to install this script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name         Plint change header between testing and production
// @description  Plint header color based on development
// @namespace    http://tampermonkey.net/
// @license      MIT
// @version      0.1
// @author       Paul Egell-Johnsen
// @match        https://*.plint.dev/*
// @match        https://*.plint.app/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=plint.dev
// @grant        GM_addStyle
// ==/UserScript==

(function() {
    'use strict';
    const mainNavbar = document.getElementById('main-navbar');
    const div = document.createElement('div');
    div.style.setProperty('font-size','2em');

    if (location.href.match(/nrk-1-core.test.plint.dev/gi)) {
        div.innerText = 'Testing';

        GM_addStyle ( `
      #main-navbar {
          background-color: #66ff66;
      }
    ` );

    }

    if (location.href.match(/nrk.plint.app/gi)) {
        div.innerText = 'Production';
        GM_addStyle ( `
      #main-navbar {
          background-color: #ff6666;
      }
    ` );
    }
    mainNavbar.appendChild( div );

})();