Skip to content

Instantly share code, notes, and snippets.

@KnIfER
Last active April 27, 2023 08:57
Show Gist options
  • Save KnIfER/4673ff34567962e8c49d6229527febed to your computer and use it in GitHub Desktop.
Save KnIfER/4673ff34567962e8c49d6229527febed to your computer and use it in GitHub Desktop.
novel_guard.user.js
// ==UserScript==
// @name 小说守护神
// @namespace https://gist.github.com/KnIfER
// @description 首次访问小说网站时,自动开启以下两项设置:-- ①禁止跨域跳转 -- ② 自动开启无图模式
// @version 1
// @match *://*/*
// @run-at document-start
// @run-at document-end
// @grant GM_blockImage
// @grant GM_blockCorsJump
// ==/UserScript==
(function() {
'use strict';
//console.log(document.title, document.body);
if(document.title.indexOf('章')>=0
&& (
document.title.indexOf('小说')>=0
|| document.title.indexOf('阅')>=0
|| document.title.indexOf('阁')>=0
|| document.title.indexOf('厢')>=0
)
&& location.host.indexOf('faloo.com')==-1
&& location.host.indexOf('17k.com')==-1
&& location.host.indexOf('zongheng.com')==-1
&& location.host.indexOf('qidian.com')==-1
&& location.host.indexOf('fanqienovel.com')==-1
)
{
if(GM_configDomain(true)) {
GM_blockImage(true);
GM_blockCorsJump(true);
}
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment