Skip to content

Conversation

@christiangenco
Copy link

Now you can do your dirty work any time between now and April 1st and the shenanigans will automatically happen at the right time!

Requires dotjs - I couldn't think of an easy way around this. Is there a Custom.css analog for javascript?

@christiangenco
Copy link
Author

On second thought, this may be a better task for Tampermonkey

// ==UserScript==
// @name       AprilFools.js
// @namespace  https://github.com/wesbos/aprilFools.css
// @version    0.1
// @description  Inserts aprilFools.css code in websites on or after April Fools 2013
// @match      http://*/*
// @copyright  2013+, @cgenco
// ==/UserScript==

// only do this *on or after* April Fools 2013
if(new Date() > new Date(2012, 3, 1, 0, 0, 0, 0))
{
  var css = document.createElement("link");
  css.setAttribute("rel", "stylesheet");
  css.setAttribute("type", "text/css");
  css.setAttribute("href", "https://raw.github.com/christiangenco/aprilFools.css/master/aprilFools.css");
  document.getElementsByTagName("head")[0].appendChild(css);
}

@Cougar
Copy link

Cougar commented Mar 29, 2013

I like the Tampermonkey/Greasemonkey idea. Easy to install it unnoticed when *monkey is used ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants