(globs: string[])
| 410 | }; |
| 411 | |
| 412 | export const extractSchemesOfGlobs = (globs: string[]): string[] => { |
| 413 | const set = new Set(["*://*/*"]); |
| 414 | for (const glob of globs) { |
| 415 | const m = /^([-\w]+):\/\//.exec(glob); |
| 416 | if (m && m[1]) { |
| 417 | if (!m[1].startsWith("http")) { |
| 418 | if (m[1] === "file") { |
| 419 | // https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Match_patterns#invalid_match_patterns |
| 420 | set.add(`${m[1]}:///*`); |
| 421 | } else { |
| 422 | set.add(`${m[1]}://*/*`); |
| 423 | } |
| 424 | } |
| 425 | } |
| 426 | } |
| 427 | return [...set]; |
| 428 | }; |
| 429 | |
| 430 | export const getApiMatchesAndGlobs = (scriptUrlPatterns: URLRuleEntry[]) => { |
| 431 | const urlMatching = scriptUrlPatterns.filter((e) => e.ruleType === RuleType.MATCH_INCLUDE); |
no test coverage detected