Auto Subs Enabler - CrunchyRoll

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

目前为 2021-07-04 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name Auto Subs Enabler - CrunchyRoll
  3. // @namespace AutoCrunchyRollSubs
  4. // @version 0.1
  5. // @description Auto enable subs on your native language by default on CrunchyRoll.
  6. // @author hacker09
  7. // @match https://www.crunchyroll.com/*
  8. // @icon https://www.crunchyroll.com/favicons/apple-touch-icon.png
  9. // @run-at document-start
  10. // @grant GM_getValue
  11. // @grant GM_setValue
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16. if (GM_getValue('NativeLanguage') === undefined) { //If the NativeLanguage variable isn't yet defined
  17. 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
  18. GM_setValue("NativeLanguage", NativeLanguage); //Store the user choice
  19. location.reload(); //Reload
  20. } //Finishes the if condition
  21.  
  22. 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
  23. switch (GM_getValue("NativeLanguage")) { //Starts the switch condition
  24. case '1': //If the user chose the option 1
  25. document.location = location.href.replace('.com/', '.com/en-gb/'); //Add the language setting to the url
  26. break; //Stop
  27. case '2': //If the user chose the option 2
  28. document.location = location.href.replace('.com/', '.com/es/'); //Add the language setting to the url
  29. break; //Stop
  30. case '3': //If the user chose the option 3
  31. document.location = location.href.replace('.com/', '.com/es-es/'); //Add the language setting to the url
  32. break; //Stop
  33. case '4': //If the user chose the option 4
  34. document.location = location.href.replace('.com/', '.com/pt-br/'); //Add the language setting to the url
  35. break; //Stop
  36. case '5': //If the user chose the option 5
  37. document.location = location.href.replace('.com/', '.com/pt-pt/'); //Add the language setting to the url
  38. break; //Stop
  39. case '6': //If the user chose the option 6
  40. document.location = location.href.replace('.com/', '.com/fr/'); //Add the language setting to the url
  41. break; //Stop
  42. case '7': //If the user chose the option 7
  43. document.location = location.href.replace('.com/', '.com/de/'); //Add the language setting to the url
  44. break; //Stop
  45. case '8': //If the user chose the option 8
  46. document.location = location.href.replace('.com/', '.com/ar/'); //Add the language setting to the url
  47. break; //Stop
  48. case '9': //If the user chose the option 9
  49. document.location = location.href.replace('.com/', '.com/it/'); //Add the language setting to the url
  50. break; //Stop
  51. case '10': //If the user chose the option 10
  52. document.location = location.href.replace('.com/', '.com/ru/'); //Add the language setting to the url
  53. break; //Stop
  54. } //Finishes the switch conditions
  55. } //Finishes the if condition
  56. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址