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.greasyforks.org/scripts/532854/1587604/hinatazaka46-process.js

// ==UserScript==
// @name            hinatazaka46-process
// @namespace       https://greasyforks.org/ja/users/1328592-naoqv
// @description	    Perform base processing
// @description:ja  基底処理を実行
// @version         0.12
// @icon            https://cdn.hinatazaka46.com/files/14/hinata/img/favicons/favicon-32x32.png
// @grant           none
// @license         MIT
// ==/UserScript==

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)/);

const getPageType = () => (location.href).match(/contents_list/) ? "contents"
  	: pageTypeMatch ? pageTypeMatch[0] : "other";

let id;
let count = 0;

const replaceLang = () => {

  const langSelect = document.getElementById('wovn-translate-widget');
  
  if (count >= 10) {
    clearInterval(id);
  }
  if (langSelect) {
    langSelect.style.top = "5px";
    document.querySelector('.wovn-lang-selector').style.height = "25px";
    document.querySelector('.wovn-lang-selector-links').style.paddingTop = "5px";
    clearInterval(id);
  }
  count++;
};


const doProcess = (proc, scriptName) => {
  
  handleException(proc, scriptName);

  handleException(() => {
    const colorMode = getColorMode();

    initializeColorToggle(colorMode);

    analyzeDefaultColor();
    setColor(getPageType(), colorMode);

  }, "HinatazakaBaseProcessor");
    
  id = setInterval(replaceLang, 200);
};
长期地址
遇到问题?请前往 GitHub 提 Issues。