Skip to content

Instantly share code, notes, and snippets.

Created December 12, 2012 19:01
Show Gist options
  • Save anonymous/4270581 to your computer and use it in GitHub Desktop.
Save anonymous/4270581 to your computer and use it in GitHub Desktop.
Drag this into chrome://chrome/extensions/ to make EY Cloud Production environments have a red background.
// ==UserScript==
// @match https://cloud.engineyard.com/*
// ==/UserScript==
// a function that loads jQuery and calls a callback function when jQuery has finished loading
function addJQuery(callback) {
var script = document.createElement("script");
script.setAttribute("src", "//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js");
script.addEventListener('load', function() {
var script = document.createElement("script");
script.textContent = "window.jQ=jQuery.noConflict(true);(" + callback.toString() + ")();";
document.body.appendChild(script);
}, false);
document.body.appendChild(script);
}
function main() {
if($('#app .environment-name').text().indexOf('production') >= 0){
$('#content').css('background', 'rgba(255, 0, 0, 0.55)')
}
}
addJQuery(main)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment