Greasy Fork

Greasy Fork is available in English.

萌娘百科预览修复

修复萌娘百科鼠标悬停预览

目前为 2024-02-15 提交的版本。查看 最新版本

// ==UserScript==
// @name        Moegirlpedia Preview Fix
// @name:zh-CN  萌娘百科预览修复
// @namespace   http://greasyfork.icu/zh-CN/users/163820-ysc3839
// @description Fix Moegirlpedia Mouse Hover Preview
// @description:zh-CN 修复萌娘百科鼠标悬停预览
// @license     MIT
// @grant       none
// @version     1.0
// @author      ysc3839
// @match       *://zh.moegirl.org.cn/*
// @run-at      document-idle
// ==/UserScript==

const $ = window.jQuery;
if ($) {
  $(document).on('ajaxSend', function(event, request, settings) {
    const u = new URL(settings.url, document.baseURI);
    if (u.pathname === '/api.php') {
      const s = u.searchParams;
      const prop = s.get('prop');
      if (prop) {
        s.set('prop', prop.split('|').filter(v => v !== 'revisions').join('|'));
        s.delete('rvprop');
        s.delete('uselang');
        settings.url = u.href;
      }
    }
  });
}