hinatazaka46-process

Perform base processing

This script should not be not be installed directly. It is a library for other scripts to include with the meta directive // @require https://update.greatest.deepsurf.us/scripts/532854/1581655/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.10
  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.  
  18. const doProcess = (proc, scriptName) => {
  19. handleException(proc, scriptName);
  20.  
  21. handleException(() => {
  22. const colorMode = getColorMode();
  23.  
  24. initilizeColorToggle(colorMode);
  25.  
  26. analyzeDefaultColor();
  27. setColor(getPageType(), colorMode);
  28. }, "HinatazakaBaseProcessor");
  29. };