(url, patterns)
| 222 | } |
| 223 | |
| 224 | function matchOneOfPatterns(url, patterns) { |
| 225 | for (let pattern of patterns) { |
| 226 | const regex = new RegExp( |
| 227 | pattern |
| 228 | .split("*") |
| 229 | .map((part) => part.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")) |
| 230 | .join(".*") |
| 231 | ); |
| 232 | if (regex.test(url)) return pattern; |
| 233 | } |
| 234 | return false; |
| 235 | } |
| 236 | |
| 237 | function lockCurrentWebsite(pass, matchedPattern) { |
| 238 | const id = "ufs_auto_lock_website_overlay"; |
no test coverage detected