Skip to content

Instantly share code, notes, and snippets.

@justinkelly
Last active February 3, 2023 04:58
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 justinkelly/fa696fe79d31b6c3a04554e2221d5ad4 to your computer and use it in GitHub Desktop.
Save justinkelly/fa696fe79d31b6c3a04554e2221d5ad4 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name EA Website testing
// @homepage https://gist.github.com/justinkelly/fa696fe79d31b6c3a04554e2221d5ad4
// @version 0.1.4
// @description EA testing
// @author Justin Kelly
// @include https://latte.nonprod.digital*
// @include https://mocha.nonprod.digital*
// @include https://preprod.nonprod.digital*
// @include https://www.energyaustralia.com.au*
// @icon https://www.energyaustralia.com.au//themes/custom/ea/assets/images/og-image-tag-2_4.jpg
// @namespace https://github.com/justinkelly/ea
// @supportURL https://github.com/justinkelly/ea
// @downloadURL https://gist.github.com/justinkelly/fa696fe79d31b6c3a04554e2221d5ad4/raw/EA_website_testing.user.js
// @updateURL https://gist.github.com/justinkelly/fa696fe79d31b6c3a04554e2221d5ad4/raw/EA_website_testing.user.js
// @grant none
// ==/UserScript==
function GM_addStyle(css) {
const style = document.getElementById("GM_addStyleBy8626") || (function() {
const style = document.createElement('style');
style.type = 'text/css';
style.id = "GM_addStyleBy8626";
document.head.appendChild(style);
return style;
})();
const sheet = style.sheet;
sheet.insertRule(css, (sheet.rules || sheet.cssRules || []).length);
}
if (window.location.href.indexOf("latte") != -1)
{
//body
GM_addStyle(".top, header {padding-top: 50px;}");
GM_addStyle(".top, header {background-color: orange;}");
GM_addStyle(".top, header {opacity: 1;}");
GM_addStyle(".top, header:before {content: 'Latte - Dev: ';}");
}
if (window.location.href.indexOf("mocha") != -1)
{
//body
GM_addStyle(".top, header {padding-top: 50px;}");
GM_addStyle(".top, header {background-color: yellow;}");
GM_addStyle(".top, header {opacity: 1;}");
GM_addStyle(".top, header:before {content: 'Mocha - Test: ';}");
}
if (window.location.href.indexOf("preprod") != -1)
{
//body
GM_addStyle(".top, header {padding-top: 50px;}");
GM_addStyle(".top, header {background-color: #FFF300;}");
GM_addStyle(".top, header {opacity: 1;}");
GM_addStyle(".top, header:before {content: 'Preprod: ';}");
}
if (window.location.href.indexOf("www") != -1)
{
//body
GM_addStyle(".top, header {padding-top: 50px;}");
GM_addStyle(".top, header {background-color: red;}");
GM_addStyle(".top, header {opacity: 1;}");
GM_addStyle(".top, header:before {content: 'Production: ';}");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment