xivanalysis zh action

Since the site admin won't take the advantage.

当前为 2020-12-27 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name xivanalysis zh action
  3. // @namespace https://xivanalysis.com/
  4. // @version 0.2
  5. // @description Since the site admin won't take the advantage.
  6. // @author Bluefissure
  7. // @match https://xivanalysis.com/*
  8. // @require http://cdn.bootcss.com/jquery/3.1.0/jquery.min.js
  9. // @require https://unpkg.com/xhook@latest/dist/xhook.min.js
  10. // @grant none
  11.  
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16. xhook.before(function(request) {
  17. if(typeof request.url === 'string' && $('.I18nMenu-module_container__2An7F').children().first()[0].childNodes[1].textContent === "简体中文"){
  18. request.url = request.url.replace("https://xivapi.com", "https://cafemaker.wakingsands.com").replace(/language=../,"language=zh");
  19. }
  20. });
  21.  
  22. })();