Skip to content

Commit f2bb2ab

Browse files
committed
[✨ Feat] Impl block block prompt (?)
1 parent 971d3db commit f2bb2ab

3 files changed

Lines changed: 56 additions & 1 deletion

File tree

src/aura/init/shared/default.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,11 @@
2626
"enabled": true
2727
},
2828
"appearance/switchUsbInsertPromptBtn": {
29-
"enabled": true,
29+
"enabled": false,
3030
"mode": "switch"
31+
},
32+
"appearance/banAdBlockPrompt": {
33+
"enabled": false
3134
}
3235
},
3336
"ssa": {
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/// Rewrite rules basic config section begins ///
2+
3+
const type = "localResource";
4+
5+
const urlPattern = "floatWindow.js";
6+
7+
/// End of the rewrite rules basic config section ///
8+
9+
let ruleFn = (originalContent, ruleConfig) => {
10+
if (ruleConfig.enabled) {
11+
originalContent = `(() => { window.close() });`;
12+
}
13+
return originalContent;
14+
};
15+
16+
module.exports = {
17+
type,
18+
urlPattern,
19+
ruleFn,
20+
};

src/aura/ui/pages/configSubPages/disableLimitations/settings/uxAppearance.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,38 @@ const uxAndAppearanceSettings = [
165165
},
166166
],
167167
},
168+
{
169+
id: 1,
170+
categoryName: "广告拦截",
171+
child: [
172+
{
173+
index: 0,
174+
id: "banAdBlockPrompt",
175+
type: "switch",
176+
name: "隐藏广告拦截悬浮窗",
177+
description: "启用后, 管家检测到未拦截广告弹窗时, 将不会再显示悬浮窗",
178+
restart: true,
179+
reload: false,
180+
warning: true,
181+
warningContent:
182+
'此功能不会完全禁用 "广告拦截" 功能, 已被拦截的广告弹窗依然会被拦截。如果您希望彻底禁用广告拦截, 请参阅 Aikari 的相关设置项 (WIP)',
183+
associateVal: [],
184+
auraIf: () => true,
185+
defaultValue: false,
186+
valueGetter: () => {
187+
return global.__HUGO_AURA_CONFIG__.networkRewrite[
188+
"appearance/banAdBlockPrompt"
189+
].enabled;
190+
},
191+
callbackFn: (newVal) => {
192+
if (typeof newVal !== "boolean") return;
193+
global.__HUGO_AURA_CONFIG__.networkRewrite[
194+
"appearance/banAdBlockPrompt"
195+
].enabled = newVal;
196+
},
197+
},
198+
],
199+
},
168200
];
169201

170202
module.exports = { uxAndAppearanceSettings };

0 commit comments

Comments
 (0)