[ Feat] Impl block block prompt (?)

This commit is contained in:
Minoricew
2025-11-30 18:33:00 +08:00
parent 971d3db43a
commit f2bb2ab06a
3 changed files with 56 additions and 1 deletions

View File

@@ -26,8 +26,11 @@
"enabled": true "enabled": true
}, },
"appearance/switchUsbInsertPromptBtn": { "appearance/switchUsbInsertPromptBtn": {
"enabled": true, "enabled": false,
"mode": "switch" "mode": "switch"
},
"appearance/banAdBlockPrompt": {
"enabled": false
} }
}, },
"ssa": { "ssa": {

View File

@@ -0,0 +1,20 @@
/// Rewrite rules basic config section begins ///
const type = "localResource";
const urlPattern = "floatWindow.js";
/// End of the rewrite rules basic config section ///
let ruleFn = (originalContent, ruleConfig) => {
if (ruleConfig.enabled) {
originalContent = `(() => { window.close() });`;
}
return originalContent;
};
module.exports = {
type,
urlPattern,
ruleFn,
};

View File

@@ -165,6 +165,38 @@ const uxAndAppearanceSettings = [
}, },
], ],
}, },
{
id: 1,
categoryName: "广告拦截",
child: [
{
index: 0,
id: "banAdBlockPrompt",
type: "switch",
name: "隐藏广告拦截悬浮窗",
description: "启用后, 管家检测到未拦截广告弹窗时, 将不会再显示悬浮窗",
restart: true,
reload: false,
warning: true,
warningContent:
'此功能不会完全禁用 "广告拦截" 功能, 已被拦截的广告弹窗依然会被拦截。如果您希望彻底禁用广告拦截, 请参阅 Aikari 的相关设置项 (WIP)',
associateVal: [],
auraIf: () => true,
defaultValue: false,
valueGetter: () => {
return global.__HUGO_AURA_CONFIG__.networkRewrite[
"appearance/banAdBlockPrompt"
].enabled;
},
callbackFn: (newVal) => {
if (typeof newVal !== "boolean") return;
global.__HUGO_AURA_CONFIG__.networkRewrite[
"appearance/banAdBlockPrompt"
].enabled = newVal;
},
},
],
},
]; ];
module.exports = { uxAndAppearanceSettings }; module.exports = { uxAndAppearanceSettings };