Greasy Fork

Greasy Fork is available in English.

[KissAnime] Beta Default Server

Sets KissAnime player to beta server.

当前为 2018-07-07 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name        [KissAnime] Beta Default Server
// @namespace   http://greasyfork.icu/en/users/193865-westleym
// @author      WestleyM
// @version     2018.07.07
// @icon        http://kissanime.ru/Content/images/favicon.ico
// @description Sets KissAnime player to beta server.
// @grant       none
// @include     http://kissanime.ru/anime/*
// @require     http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// ==/UserScript==

var updateLink = '&s=beta&pfail=2';

//Redirect to the beta server if the script detects you are on the default one
if(window.location.href.indexOf("&s=default") > -1) {
  window.stop();
  var currentLink = window.location.href;
  currentLink = currentLink.replace('&s=default', updateLink);
  location.replace(currentLink);
}

//Works when on the page for watching the anime
try {
  //Updates the links in the episode box
  var selectEpisode = $("#selectEpisode").find("option").toArray();
  if (selectEpisode != null) {
  	selectEpisode.forEach(function(episodeLink) {
  	  episodeLink.value += updateLink;
  	});
  }
  
  //Updates the link on the "previous" button
  var btnPrevious = $("#btnPrevious").parent()[0];
  if (btnPrevious != null) {
  	btnPrevious.href += updateLink;
  }
  
  //Updates the link on the "next" button
  var btnNext = $("#btnNext").parent()[0];
  if (btnNext != null) {
  	btnNext.href += updateLink;
	}
}
catch(err) {
  console.log("There was an error: " + err);
}