(url: string, list: string[])
| 329 | const indexedSiteLists = new WeakMap<string[], URLTemplateIndex>(); |
| 330 | |
| 331 | function isInListOptimized(url: string, list: string[]) { |
| 332 | if (!url || list.length === 0) { |
| 333 | return false; |
| 334 | } |
| 335 | let index = indexedSiteLists.get(list); |
| 336 | if (!index) { |
| 337 | index = indexURLTemplateList(list); |
| 338 | indexedSiteLists.set(list, index); |
| 339 | } |
| 340 | return isURLInIndexedList(url, index); |
| 341 | } |
| 342 | |
| 343 | export function isURLEnabled(url: string, userSettings: UserSettings, {isProtected, isInDarkList, isDarkThemeDetected}: Partial<TabInfo>, isAllowedFileSchemeAccess = true): boolean { |
| 344 | if (isLocalFile(url) && !isAllowedFileSchemeAccess) { |
no test coverage detected