Skip to content

Instantly share code, notes, and snippets.

@Gishi1
Last active May 6, 2024 23:43
Show Gist options
  • Save Gishi1/fc7c69aa994b3eebfe01e2d2b489ecd2 to your computer and use it in GitHub Desktop.
Save Gishi1/fc7c69aa994b3eebfe01e2d2b489ecd2 to your computer and use it in GitHub Desktop.
WebNovel genre and paywall filter
// ==UserScript==
// @name WebNovel genre and paywall filter
// @namespace https://www.webnovel.com/
// @version 1.10
// @description Genre filter and paywall filter for WebNovel.com!
// @author idMysteries and Gishi
// @match https://www.webnovel.com/stories/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=webnovel.com
// @license Unlicense
// @grant none
// ==/UserScript==
const preferlist = ['# ROMANCE', '# REINCARNATION', '# HAREM', '# SMUT', '# ISEKAI', '# R18', '# ACTION'];
const hidelist = ['# TRAGEDY', '# YAOI', '# NO-HAREM', '# BL'];
const blocklist = ['/book/the-dark-avatar_19831406406525805',
'/book/gamer-chat-group_19538419206720505',
'/book/solo-leveling-avatarr_20293566506098405',
'/book/attack-on-titan-mutant-system_19306939105958505',
'/book/dxd-meta-essence-gacha_27252217606169605',
'/book/naruto-beast-system_24893181105165405',
'/book/dxd-gilgamesh-with-solo-leveling-system_24419695505300205',
'/book/cyberpunk-edgerunners-hacker-system_24540721606161705',
'/book/chainsaw-man-system_24775381505806105',
'/book/marvel-mutant-beast-system_24957438305393705',
'/book/fate-villain-system_25206723206456305',
'/book/reborn-in-bleach-with-op-wishes_20989746706785305',
'/book/dxd-devil-sister-testament-hybrid_21128235906520105',
'/book/reborn-in-genshin-impact-with-system_21222837806880305',
'/book/solo-leveling-avatarrrrr_21223243805637705',
'/book/marvel-strongest-gamer_21525335306778905',
'/book/bleach-hollow-gamer_22269001605214405',
'/book/spider-verse-mutant-gamer_22337813206000805',
'/book/reborn-in-black-clover-with-op-system_23089787506156405',
'/book/naruto-dark-gamer_23521706406333205',
'/book/marvel-kryptonian-gamer_23573367306660105',
'/book/spy-x-family-system_23573658905399105',
'/book/netori-system_18189386705628305',
'/book/reborn-in-agk-with-system_19589246505698605',
'/book/marvel-super-god_19885230605644805',
'/book/chainsawman-fanfic-%5Bnew-version-is-out-darkgamerz%5D_20055982105930405',
'/book/mha-villain-gamer-system_20233449005308405',
'/book/lust-tamer-system_19969301806277005',
'/book/danmachi-hentai-system_25207275305196605',
'/book/dxd-meta-gacha-essencesssss-%5Bnew-fic-up%5D_25224104606505005',
'/book/kanokari-romcom-system_25224195905246205',
'/book/mha-villain-system_25405182406105505',
'/book/black-lagoon-mob-system_25498563906341005',
'/book/fairy-tail-dragon-shinigami_25920887106625905',
'/book/marvel-reborn-as-carnage_26103131205040205',
'/book/hentai-multiverse-system_26165372705251605',
'/book/pokemon-the-legend_26180589205305905',
'/book/bleach-gamer-system_26224342806689405',
'/book/genshin-impact-archon-gamer_26241045905504105',
'/book/dc-villain-gacha-essences_26355810906093805',
'/book/attack-on-titan-mutant-systemmm_26431338206335705',
'/book/marvel-anime-system_14381039706244105',
'/book/fate-hentai-system_25240165405284305' ,
'/book/marvel-lust-mage-%5Bhp-x-marvel%5D_27251688105919005' ,
'/book/in-black-clover-with-a-system_18327452705236505' ,
'/book/multiversal-harem-shop_26353605106088705' ,
'/book/multiverse-harem-shop_26353605106088705' ,
'/book/solo-leveling-avatar-%5Boriginal%5D_20293566506098405',
'/book/naruto-rape-system_27625512400450005',
'/book/marvel-demon-gamer_14615216705951205',
'/book/fairy-tail-dragon-god_15687353206759005',
'/book/dragon-ga-kill_16024345805688005',
'/book/naruto-resurrection_14622746106049205',
'/book/dragon-ga-kill-%5Boriginal%5D_13069022206601805' ,
'/book/reborn-as-op-gojo-in-jjk-with-bleach-powers_27736027100920905' ,
'/book/reborn-as-op-gojo-in-jjk_27736027100920905' ,
'/book/marvel-sex-summon-system_27796501508279105' ,
'/book/dc-i-am-batman-with-gacha-system_27979466000147405' ,
'/book/game-of-thrones-dragon-overlordd_17613176106920005'];
(function() {
'use strict';
var mutationObserver = new MutationObserver(function(mutations) {
var novels = document.querySelectorAll('li.fl')
for (var novel of novels) {
var nplist = 0;
var novellinks = novel.getElementsByTagName('a');
for (var novellink of novellinks) {
if (hidelist.includes(novellink.innerHTML)) {
novel.remove();
break;
}
if (blocklist.includes(novellink.getAttribute('href'))) {
novel.remove();
break;
}
//console.log(novellink.innerHTML);
for (var pflist of preferlist){
if(novellink.innerHTML.includes(pflist)){
if(nplist < 5){nplist = nplist + 1;}
}
//console.log(llink);
}
}
switch(nplist) {
case 1:
novel.style = 'border-radius: 15px;border: 1px solid #eee;background-image: radial-gradient(circle, #424d4e, #343a3d, #27272b, #181718, #000000);';
break;
case 2:
novel.style = 'border-radius: 15px;border: 1px solid #eee;background-image: radial-gradient(circle, #4e4e42, #49493f, #44443c, #404039, #3b3b36);';
break;
case 3:
novel.style = 'border-radius: 15px;border: 1px solid #eee;background-image: radial-gradient(circle, #5d896c, #567b61, #4f6d57, #48604d, #405343);';
break;
case 4:
novel.style = 'border-radius: 15px;border: 1px solid #eee;background-image: radial-gradient(circle, #a3d62d, #a1ca35, #9ebe3c, #9bb242, #96a647);';
break;
case 5:
novel.style = 'border-radius: 15px;border: 1px solid #eee;background-image: radial-gradient(circle, #38a9da, #2294cd, #107fbe, #0b6aae, #13559d);';
break;
default:
novel.style = 'border-radius: 15px;border: 1px solid #eee;background-image: radial-gradient(circle, #e95050, #f04342, #f63532, #fb231f, #ff0000);';
}
}
});
mutationObserver.observe(document.documentElement, {
attributes: false,
characterData: false,
childList: true,
subtree: true,
attributeOldValue: false,
characterDataOldValue: false
});
})
();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment