mirror of
https://github.com/gorhill/uBlock.git
synced 2024-10-02 23:57:10 +02: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
@ -192,7 +192,9 @@ class PSelectorMatchesMediaTask extends PSelectorTask {
|
||||
class PSelectorMatchesPathTask extends PSelectorTask {
|
||||
constructor(task) {
|
||||
super();
|
||||
this.needle = regexFromString(task[1]);
|
||||
this.needle = regexFromString(
|
||||
task[1].replace(/\P{ASCII}/gu, s => encodeURIComponent(s))
|
||||
);
|
||||
}
|
||||
transpose(node, output) {
|
||||
if ( this.needle.test(self.location.pathname + self.location.search) ) {
|
||||
|
@ -161,7 +161,9 @@ class PSelectorMatchesMediaTask extends PSelectorTask {
|
||||
class PSelectorMatchesPathTask extends PSelectorTask {
|
||||
constructor(task) {
|
||||
super();
|
||||
this.needle = regexFromString(task[1]);
|
||||
this.needle = regexFromString(
|
||||
task[1].replace(/\P{ASCII}/gu, s => encodeURIComponent(s))
|
||||
);
|
||||
}
|
||||
transpose(node, output) {
|
||||
if ( this.needle.test(self.location.pathname + self.location.search) ) {
|
||||
|
Loading…
Reference in New Issue
Block a user