Lucifers HappyPlace Redirect

Forces to load of happyplace copyright mwscripts.com

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name           Lucifers HappyPlace Redirect
// @version        0.1.6
// @namespace      HappyPlace
// @description    Forces to load of happyplace copyright mwscripts.com
// @include        http://apps.facebook.com/inthemafia/*
// @include        https://apps.facebook.com/inthemafia/*
// @match          http://apps.facebook.com/inthemafia/*
// @match          https://apps.facebook.com/inthemafia/*
// @run-at         document-start
// ==/UserScript==
var script_version = '0.1.6';

javascript: (function () {
    var http = 'http://';
    if (/https/.test(document.location)) {
        http = 'https://';
    }
    //    try{ 
    if ((/apps.facebook.com\/inthemafia/.test(document.location.href)) || (/facebook.mafiawars.zynga.com/.test(document.location.href))) {
        var happyplace_url = document.location.href.replace(http + 'apps.facebook.com', '')


        if (/happyplace_nofollow/.test(document.location.href)) {
            return false;
        }

        /*
         if (/next_params\=/.test(document.location.href)) {
           redirect(happyplace_url);
         }
         
        if (/inthemafia\/\?/.test(document.location.href)) {
            redirect(happyplace_url);
         }
         */
        if (/index.php/.test(document.location.href)) {
            redirect(happyplace_url)
        }
        if (((/appage&ref=bookmarks/.test(document.location.href)) || (document.location.href == http + "apps.facebook.com/inthemafia/"))) {
            //(/inthemafia\/\?next_params/.test(document.location.href)
            redirect();
        }
    }
    //        }catch(e){} 

    function redirect(parsedata) {
        var redirectto = 'http://mwscripts.com/happyplace'
        if (parsedata) redirectto += parsedata + '&happyplace_redirect_v2=true';


        document.location.href = redirectto;
    }



}())