fix: Minimize the rule file
This commit is contained in:
@@ -198,7 +198,7 @@ const RULES_MAP = {
|
|||||||
export const BUILTIN_RULES = Object.entries(RULES_MAP)
|
export const BUILTIN_RULES = Object.entries(RULES_MAP)
|
||||||
.sort((a, b) => a[0].localeCompare(b[0]))
|
.sort((a, b) => a[0].localeCompare(b[0]))
|
||||||
.map(([pattern, rule]) => ({
|
.map(([pattern, rule]) => ({
|
||||||
...DEFAULT_RULE,
|
// ...DEFAULT_RULE,
|
||||||
...rule,
|
...rule,
|
||||||
pattern,
|
pattern,
|
||||||
}));
|
}));
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ export const matchRule = async (href, { injectRules, subrulesList }) => {
|
|||||||
// "detectRemote",
|
// "detectRemote",
|
||||||
// "fixerFunc",
|
// "fixerFunc",
|
||||||
].forEach((key) => {
|
].forEach((key) => {
|
||||||
if (rule[key] === undefined || rule[key] === GLOBAL_KEY) {
|
if (!rule[key] || rule[key] === GLOBAL_KEY) {
|
||||||
rule[key] = globalRule[key];
|
rule[key] = globalRule[key];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -90,7 +90,7 @@ export const matchRule = async (href, { injectRules, subrulesList }) => {
|
|||||||
// if (!rule.skipLangs || rule.skipLangs.length === 0) {
|
// if (!rule.skipLangs || rule.skipLangs.length === 0) {
|
||||||
// rule.skipLangs = globalRule.skipLangs;
|
// rule.skipLangs = globalRule.skipLangs;
|
||||||
// }
|
// }
|
||||||
if (rule.textStyle === GLOBAL_KEY) {
|
if (!rule.textStyle || rule.textStyle === GLOBAL_KEY) {
|
||||||
rule.textStyle = globalRule.textStyle;
|
rule.textStyle = globalRule.textStyle;
|
||||||
rule.bgColor = globalRule.bgColor;
|
rule.bgColor = globalRule.bgColor;
|
||||||
rule.textDiyStyle = globalRule.textDiyStyle;
|
rule.textDiyStyle = globalRule.textDiyStyle;
|
||||||
|
|||||||
Reference in New Issue
Block a user