Skip to content

Commit 0353ef0

Browse files
committed
Update pagetual.user.js
1 parent 9b95e05 commit 0353ef0

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

Pagetual/pagetual.user.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2209,6 +2209,11 @@
22092209
if (!this.hpRules) this.hpRules = [];
22102210
let url = this.curSiteRule && this.curSiteRule.url, self = this;
22112211
let href = location.href.slice(0, 500);
2212+
if (instead) {
2213+
this.hpRules = this.hpRules.filter(item => {
2214+
return item && !(new RegExp(item.url, "i").test(href) && self.ruleMatch(item));
2215+
});
2216+
}
22122217
let matchedRules = this.hpRules.filter(rule => JSON.stringify(rule) != JSON.stringify(self.curSiteRule) && new RegExp(rule.url, "i").test(href) && self.ruleMatch(rule));
22132218
if (url) matchedRules.unshift(this.curSiteRule);
22142219
matchedRules.sort((a, b) => {
@@ -5742,12 +5747,6 @@
57425747
ruleParser.customRules.unshift(editTemp);
57435748
ruleParser.curSiteRule = editTemp;
57445749
} else {
5745-
if (ruleParser.hpRules) {
5746-
let href = location.href.slice(0, 500);
5747-
ruleParser.hpRules = ruleParser.hpRules.filter(item => {
5748-
return item && !(new RegExp(item.url, "i").test(href) && ruleParser.ruleMatch(item));
5749-
});
5750-
}
57515750
ruleParser.curSiteRule = {};
57525751
isPause = true;
57535752
}

0 commit comments

Comments
 (0)