Always Your Derpibooru

Automatically redirects you to the Derpibooru domain of your choice when linked to a different domain.

目前為 2016-03-25 提交的版本,檢視 最新版本

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

You will need to install an extension such as Tampermonkey to install this script.

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

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

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

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

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name        Always Your Derpibooru
// @namespace   Always Your Derpibooru
// @description Automatically redirects you to the Derpibooru domain of your choice when linked to a different domain. 
// @author      DanielTepesKraus | https://www.derpibooru.org/profiles/DanielTepesKraus
// @include     https://derpibooru.org/*
// @include     https://www.derpibooru.org/*
// @include     https://derpiboo.ru/*
// @include     https://www.derpiboo.ru/*
// @include     https://trixiebooru.org*
// @include     https://www.trixiebooru.org*
// @version     1
// @grant       none
// @run-at document-start
// ==/UserScript==
'use strict';

//////////////////////////////////////////////////////////
//THIS IS WHERE YOU SET WHAT DOMAIN YOU WOULD LIKE TO USE.

var Domain = 0;
//0 = Derpibooru.org
//1 = Derpiboo.ru
//2 = Trixiebooru.org
//3 = Krausbooru.org (see note)

//Note:
//Krausbooru is an experimental version of Derpibooru.
//Uses "derpibooru.org" with a vastly improved 
//and more aesthetically pleasing GUI.
//Use at your own risk.

//DON'T TOUCH ANYTHING BELOW THIS LINE.
//////////////////////////////////////////////////////////

var Location = window.location.href;
var ORG = Location.indexOf("derpibooru.org");
var RU = Location.indexOf("derpiboo.ru");
var TRX = Location.indexOf("trixiebooru.org");

window.addEventListener('focus', function() {
  if (Domain == 3){
    var NewName = document.getElementsByClassName("home hide-mobile-t");
    NewName[0].innerHTML = "<img src='http://i.imgur.com/yHTYOEq.png'><a href='/'>Krausbooru</a>";
  }
}, false);

if (TRX > -1){
  if (Domain == 0){
    window.location.replace(Location.replace("trixiebooru.org","derpibooru.org"));
  }else if (Domain == 1){
    window.location.replace(Location.replace("trixiebooru.org","derpiboo.ru"));
  }else if (Domain == 3){
    window.location.replace(Location.replace("trixiebooru.org","derpibooru.org"));
  }
}else if (ORG > -1){
  if (Domain == 1){
    window.location.replace(Location.replace("derpibooru.org","derpiboo.ru"));
  }else if (Domain == 2){
    window.location.replace(Location.replace("derpibooru.org","trixiebooru.org"));
  }
}else if (RU > -1){
  if (Domain == 0){
    window.location.replace(Location.replace("derpiboo.ru","derpibooru.org"));
  }else if (Domain == 2){
    window.location.replace(Location.replace("derpiboo.ru","trixiebooru.org"));
  }else if (Domain == 3){
    window.location.replace(Location.replace("derpiboo.ru","derpibooru.org"));
  }
}