mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-07-04 04:26:35 +02:00
parent
cfb09075eb
commit
4bd0c0c96c
4 changed files with 16 additions and 5 deletions
|
@ -29,9 +29,12 @@
|
|||
})
|
||||
.map(function(entry){
|
||||
let regExp;
|
||||
const domain = !!entry.match(/^[A-Za-z0-9_.-]+$/);
|
||||
const domain = !!entry.match(/^[A-Za-z0-9_.*-]+$/);
|
||||
if (domain){
|
||||
regExp = new RegExp("(?:^|\\.)" + entry.replace(/([\\+*?[^\]$(){}=!|.])/g, "\\$1") + "\\.?$", "i");
|
||||
regExp = new RegExp(
|
||||
"(?:^|\\.)" + entry.replace(/([\\+?[^\]$(){}=!|.])/g, "\\$1").replace(/\*/g, ".+") + "\\.?$",
|
||||
"i"
|
||||
);
|
||||
}
|
||||
else {
|
||||
try {
|
||||
|
|
|
@ -166,10 +166,10 @@
|
|||
|
||||
function initializeUrlSetting(urlSetting){
|
||||
let regExp;
|
||||
const domain = !!urlSetting.url.match(/^[A-Za-z0-9_.-]+$/);
|
||||
const domain = !!urlSetting.url.match(/^[A-Za-z0-9_.*-]+$/);
|
||||
if (domain){
|
||||
regExp = new RegExp(
|
||||
"(?:^|\\.)" + urlSetting.url.replace(/([\\+*?[^\]$(){}=!|.])/g, "\\$1") + "\\.?$",
|
||||
"(?:^|\\.)" + urlSetting.url.replace(/([\\+?[^\]$(){}=!|.])/g, "\\$1").replace(/\*/g, ".+") + "\\.?$",
|
||||
"i"
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue