mirror of
https://github.com/gorhill/uBlock.git
synced 2026-03-11 09:04:36 +00:00
Normalize non-ASCII characters in :matches-path() argument
Related issue: - https://github.com/uBlockOrigin/uBlock-issues/issues/2369
This commit is contained in:
parent
c8af55e27a
commit
a8a46c4593
2 changed files with 6 additions and 2 deletions
|
|
@ -192,7 +192,9 @@ class PSelectorMatchesMediaTask extends PSelectorTask {
|
||||||
class PSelectorMatchesPathTask extends PSelectorTask {
|
class PSelectorMatchesPathTask extends PSelectorTask {
|
||||||
constructor(task) {
|
constructor(task) {
|
||||||
super();
|
super();
|
||||||
this.needle = regexFromString(task[1]);
|
this.needle = regexFromString(
|
||||||
|
task[1].replace(/\P{ASCII}/gu, s => encodeURIComponent(s))
|
||||||
|
);
|
||||||
}
|
}
|
||||||
transpose(node, output) {
|
transpose(node, output) {
|
||||||
if ( this.needle.test(self.location.pathname + self.location.search) ) {
|
if ( this.needle.test(self.location.pathname + self.location.search) ) {
|
||||||
|
|
|
||||||
|
|
@ -161,7 +161,9 @@ class PSelectorMatchesMediaTask extends PSelectorTask {
|
||||||
class PSelectorMatchesPathTask extends PSelectorTask {
|
class PSelectorMatchesPathTask extends PSelectorTask {
|
||||||
constructor(task) {
|
constructor(task) {
|
||||||
super();
|
super();
|
||||||
this.needle = regexFromString(task[1]);
|
this.needle = regexFromString(
|
||||||
|
task[1].replace(/\P{ASCII}/gu, s => encodeURIComponent(s))
|
||||||
|
);
|
||||||
}
|
}
|
||||||
transpose(node, output) {
|
transpose(node, output) {
|
||||||
if ( this.needle.test(self.location.pathname + self.location.search) ) {
|
if ( this.needle.test(self.location.pathname + self.location.search) ) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue