Lucifers HappyPlace Redirect

Forces to load of happyplace copyright mwscripts.com

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 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;
    }



}())