Quantcast

Jump to content


TehHacker

Member Since 15 Nov 2009
Offline Jul 30 2010 12:42 PM

Topics I've Started

How to Stop the Snow with GreaseMonkey!

26 December 2009 - 10:58 PM

All Credits to "piouPiouM" of UserScripts.org for making this script.

Source Code:
// ==UserScript==
// @name SnowStorm Killer
// @namespace http://pioupioum.fr
// @description Remove "Snow Storm" effect added by Snowstorm script.
// @version 1.1
// @author Mehdi Kabab
// @include *
// ==/UserScript==
/*
# ***** BEGIN LICENSE BLOCK *****
# Copyright (C) 2008 Mehdi Kabab [url="http://pioupioum.fr/"]<http://pioupioum.fr/>[/url].
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see [url="http://www.gnu.org/licenses/"]<http://www.gnu.org/licenses/>[/url].
#
# ***** END LICENSE BLOCK ***** */

(function(){
 var SnowStormKiller = function() {
 const NO_SNOWSTORM = -1, SNOWSTORM_12 = 0, SNOWSTORM_13 = 1;
 var s;

 function checkScript() {
 var ret = NO_SNOWSTORM;
 
 if ('function' == typeof unsafeWindow.SnowStorm)
 {
 // Detect version 1.2
 if ('function' == typeof unsafeWindow.snowStormInit)
 {
 ret = SNOWSTORM_12;
 }
 // version 1.3
 else
 {
 s = unsafeWindow.snowStorm;
 
 if ('object' == typeof s && 'function' == typeof s.stop)
 {
 ret = SNOWSTORM_13;
 }
 }
 }
 
 return ret;
 }; // checkScript

 function forceReset() {
 unsafeWindow.SnowStorm = function() {};
 }; // forceReset

 function process() {
 var flakes = s.flakes, h;
 
 if (0 === flakes.length)
 return;
 
 s.stop();
 
 h = flakes[0].o.parentNode;
 for (var i = 0, f; f = flakes[i++]<img src='http://www.neocodex.us/forum/public/style_emoticons/<#EMO_DIR#>/wink.gif' class='bbc_emoticon' alt=';)' />
 {
 h.removeChild(f.o);
 }
 
 s = unsafeWindow.snowStorm = undefined;
 forceReset();
 }; // process

 return {
 init: function() {
 switch (checkScript())
 {
 case SNOWSTORM_13:
 process();
 break;
 case SNOWSTORM_12:
 forceReset();
 break;
 case NO_SNOWSTORM:
 default:
 return;
 }
 } // init
 };
 }();

 SnowStormKiller.init();
})();
Download:

http://userscripts.o...e/39351.user.js