Auto Subs Enabler - CrunchyRoll

Auto enable subs on your native language by default on CrunchyRoll.

安装此脚本
作者推荐脚本

您可能也喜欢Quizlet Show Hidden Flashcards

安装此脚本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Auto Subs Enabler - CrunchyRoll
// @namespace    AutoCrunchyRollSubs
// @version      4
// @description  Auto enable subs on your native language by default on CrunchyRoll.
// @author       hacker09
// @match        https://www.crunchyroll.com/*
// @exclude      https://www.crunchyroll.com/search?q=*
// @icon         https://www.crunchyroll.com/favicons/apple-touch-icon.png
// @run-at       document-start
// @grant        GM_getValue
// @grant        GM_setValue
// ==/UserScript==

(function() {
  'use strict';
  if (GM_getValue('NativeLanguage') === undefined) { //If the NativeLanguage variable isn't yet defined
    var NativeLanguage = prompt("What's your native language?\n1 English (UK)\n2 Español (América Latina)\n3 Español (España)\n4 Português (Brasil)\n5 Português (Portugal)\n6 Français (France)\n7 Deutsch\n8 Arabic\n9 Italiano\n10 Русский"); //Give an option to the user
    GM_setValue("NativeLanguage", NativeLanguage); //Store the user choice
    location.reload(); //Reload
  } //Finishes the if condition

  if (location.href.match(/(.com\/)(en-gb|es|es-es|pt-br|pt-pt|fr|de|ar|it|ru)/) === null) { //If the url has no language settings
    switch (GM_getValue("NativeLanguage")) { //Starts the switch condition
      case '1': //If the user chose the option 1
        document.location = location.href.replace('.com/', '.com/en-gb/'); //Add the language setting to the url
        break; //Stop
      case '2': //If the user chose the option 2
        document.location = location.href.replace('.com/', '.com/es/'); //Add the language setting to the url
        break; //Stop
      case '3': //If the user chose the option 3
        document.location = location.href.replace('.com/', '.com/es-es/'); //Add the language setting to the url
        break; //Stop
      case '4': //If the user chose the option 4
        document.location = location.href.replace('.com/', '.com/pt-br/'); //Add the language setting to the url
        break; //Stop
      case '5': //If the user chose the option 5
        document.location = location.href.replace('.com/', '.com/pt-pt/'); //Add the language setting to the url
        break; //Stop
      case '6': //If the user chose the option 6
        document.location = location.href.replace('.com/', '.com/fr/'); //Add the language setting to the url
        break; //Stop
      case '7': //If the user chose the option 7
        document.location = location.href.replace('.com/', '.com/de/'); //Add the language setting to the url
        break; //Stop
      case '8': //If the user chose the option 8
        document.location = location.href.replace('.com/', '.com/ar/'); //Add the language setting to the url
        break; //Stop
      case '9': //If the user chose the option 9
        document.location = location.href.replace('.com/', '.com/it/'); //Add the language setting to the url
        break; //Stop
      case '10': //If the user chose the option 10
        document.location = location.href.replace('.com/', '.com/ru/'); //Add the language setting to the url
        break; //Stop
    } //Finishes the switch conditions
  } //Finishes the if condition
})();