Hitomi语言设置

将所有语言页面更改为特定语言结果页面。

  1. // ==UserScript==
  2. // @name:ko Hitomi 언어 설정
  3. // @name Hitomi Language Settings
  4. // @name:ru Hitomi Настройка языка
  5. // @name:ja Hitomi言語設定
  6. // @name:zh-TW Hitomi語言設置
  7. // @name:zh-CN Hitomi语言设置
  8.  
  9. // @description:ko 모든 언어 페이지를 특정 언어 결과 페이지로 변경합니다.
  10. // @description Change all language page to specific language result page.
  11. // @description:ru Измените все языковые страницы на страницы результатов на определенном языке.
  12. // @description:ja すべての言語ページを特定の言語結果ページに変更します。
  13. // @description:zh-TW 將所有語言頁面更改爲特定語言結果頁面。
  14. // @description:zh-CN 将所有语言页面更改为特定语言结果页面。
  15.  
  16. // @namespace https://ndaesik.tistory.com/
  17. // @version 2023.05.01.05.26
  18. // @author ndaesik
  19. // @icon https://t2.gstatic.com/faviconV2?client=SOCIAL&type=FAVICON&fallback_opts=TYPE,SIZE,URL&url=http://hitomi.la
  20. // @match https://*.la/*
  21.  
  22. // @grant GM.getValue
  23. // @grant GM.setValue
  24. // @grant GM_registerMenuCommand
  25. // ==/UserScript==
  26. if (window.location.hostname === 'hitomi.la') {
  27. (async () => {
  28. (await GM.getValue('custom') == undefined) ? GM.setValue('custom', '') : await GM.getValue('custom')
  29. let cst = (await GM.getValue('custom') || '').toLowerCase()
  30. , set = _ => {GM.setValue('custom', window.prompt('Type your language',)); window.location.reload()}
  31. , nav = {id:'indonesian',ca:'catalan',cs:'czech',da:'danish',de:'german',et:'estonian',en:'english',es:'spanish',eo:'esperanto',fr:'french',
  32. hi:'hindi',it:'italian',hu:'hungarian',nl:'dutch',nb:'norwegian',pl:'polish',pt:'portuguese',ro:'romanian',sq:'albanian',sk:'slovak',
  33. sr:'serbian',fi:'finnish',sv:'swedish',tl:'tagalog',vi:'vietnamese',tr:'turkish',el:'greek',bg:'bulgarian',mn:'mongolian',ru:'russian',
  34. uk:'ukrainian',he:'hebrew',ar:'arabic',th:'thai',ko:'korean',zh:'chinese',ja:'japanese'}
  35. , txt = (cst == '') ? nav[window.navigator.language.substring(0,2)] : cst
  36. , mov = _ => {window.location = window.location.toString().replace(/-all\./, `-${txt}\.`)}
  37. , tar = document.querySelector('#lang > a')
  38.  
  39. document.querySelector('#logo > a')?.setAttribute('href', `https://hitomi.la/index-${txt}.html`);
  40. if (document.URL.indexOf(`-${txt}\.`) > -1) {
  41. window.onpopstate = _ => history.go(-2)
  42. history.pushState({}, '')
  43. }
  44. if (document.URL.indexOf('-all.html') > -1) mov()
  45. if (tar) {
  46. tar.href = `https://hitomi.la/index-${txt}.html`
  47. tar.innerHTML = `${txt}<img src="//ltn.hitomi.la/down-arrow.png">`
  48. tar.style.cssText = 'padding: 0 10px; width: 150px; display: inline-block'}
  49. GM_registerMenuCommand('Set your language', set)
  50. })()
  51. }

QingJ © 2025

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