Bulbapedia Cleanup

Removes content from Bulbapedia Pokemon pages that doesn't pertain to the games (shows, manga, etc)

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name     	Bulbapedia Cleanup 
// @version  	1.2
// @grant    	none
// @namespace   none
// @description Removes content from Bulbapedia Pokemon pages that doesn't pertain to the games (shows, manga, etc)
// @icon 	https://bulbapedia.bulbagarden.net/favicon.ico
// @match    	https://bulbapedia.bulbagarden.net/wiki/*
// @require  	https://cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js
// @run-at 	document-idle
// @license     MIT
// @author      hangedmandesign
// ==/UserScript==

(function() {
    'use strict';
  	var $ = window.jQuery;
    if (window.top !== window.self) { return; }

    //detect start and end of areas to remove
		var tocHideStart = $("a[href='#Biology']").closest("li");
    var tocHideEnd = $("a[href='#Game_data']").closest("li");
    var hideStart = $("#Biology").closest("h2");
    var hideEnd = $("#Game_data").closest("h2");
    var tocHideElement = $(tocHideStart).nextUntil(tocHideEnd);
    var hideElement = $(hideStart).nextUntil(hideEnd);
    console.log("detected bulba junk ok");
          
    //there's a way to do this more efficiently to include the starting element but whatever
    hideElement.remove();
    hideStart.remove();
    tocHideElement.remove();
    tocHideStart.remove();
})();