hinatazaka46-process

Perform base processing

Este script no debería instalarse directamente. Es una biblioteca que utilizan otros scripts mediante la meta-directiva de inclusión // @require https://update.greatest.deepsurf.us/scripts/532854/1587604/hinatazaka46-process.js

  1. // ==UserScript==
  2. // @name hinatazaka46-process
  3. // @namespace https://greatest.deepsurf.us/ja/users/1328592-naoqv
  4. // @description Perform base processing
  5. // @description:ja 基底処理を実行
  6. // @version 0.12
  7. // @icon https://cdn.hinatazaka46.com/files/14/hinata/img/favicons/favicon-32x32.png
  8. // @grant none
  9. // @license MIT
  10. // ==/UserScript==
  11.  
  12. const pageTypeMatch = (location.href).match(/(news|media|detail|search|formation|diary\/member\/list|diary\/member|diary\/detail|artist\/00|artist|greeting|biography|video|contents|discography|aimashou|event|about_fanclub)/);
  13.  
  14. const getPageType = () => (location.href).match(/contents_list/) ? "contents"
  15. : pageTypeMatch ? pageTypeMatch[0] : "other";
  16.  
  17. let id;
  18. let count = 0;
  19.  
  20. const replaceLang = () => {
  21.  
  22. const langSelect = document.getElementById('wovn-translate-widget');
  23. if (count >= 10) {
  24. clearInterval(id);
  25. }
  26. if (langSelect) {
  27. langSelect.style.top = "5px";
  28. document.querySelector('.wovn-lang-selector').style.height = "25px";
  29. document.querySelector('.wovn-lang-selector-links').style.paddingTop = "5px";
  30. clearInterval(id);
  31. }
  32. count++;
  33. };
  34.  
  35.  
  36. const doProcess = (proc, scriptName) => {
  37. handleException(proc, scriptName);
  38.  
  39. handleException(() => {
  40. const colorMode = getColorMode();
  41.  
  42. initializeColorToggle(colorMode);
  43.  
  44. analyzeDefaultColor();
  45. setColor(getPageType(), colorMode);
  46.  
  47. }, "HinatazakaBaseProcessor");
  48. id = setInterval(replaceLang, 200);
  49. };