API > wxt/utils/match-patterns > MatchPattern
Class: MatchPattern
Class for parsing and performing operations on match patterns.
Contents
Example
const pattern = new MatchPattern('*://google.com/*');
pattern.includes('https://google.com'); // true
pattern.includes('http://youtube.com/watch?v=123'); // falseConstructors
new MatchPattern(matchPattern)
new MatchPattern(
matchPattern):MatchPattern
Parse a match pattern string. If it is invalid, the constructor will throw an InvalidMatchPattern error.
Parameters
▪ matchPattern: string
The match pattern to parse.
Source
node_modules/.bun/@webext-core+match-patterns@2.0.0/node_modules/@webext-core/match-patterns/dist/index.d.mts:23
Properties
convertPatternToRegex
privateconvertPatternToRegex:any
Source
node_modules/.bun/@webext-core+match-patterns@2.0.0/node_modules/@webext-core/match-patterns/dist/index.d.mts:34
escapeForRegex
privateescapeForRegex:any
Source
node_modules/.bun/@webext-core+match-patterns@2.0.0/node_modules/@webext-core/match-patterns/dist/index.d.mts:35
hostnameMatch
privatehostnameMatch:any
Source
node_modules/.bun/@webext-core+match-patterns@2.0.0/node_modules/@webext-core/match-patterns/dist/index.d.mts:14
isAllUrls
privateisAllUrls?:any
Source
node_modules/.bun/@webext-core+match-patterns@2.0.0/node_modules/@webext-core/match-patterns/dist/index.d.mts:16
isFileMatch
privateisFileMatch:any
Source
node_modules/.bun/@webext-core+match-patterns@2.0.0/node_modules/@webext-core/match-patterns/dist/index.d.mts:31
isFtpMatch
privateisFtpMatch:any
Source
node_modules/.bun/@webext-core+match-patterns@2.0.0/node_modules/@webext-core/match-patterns/dist/index.d.mts:32
isHostPathMatch
privateisHostPathMatch:any
Source
node_modules/.bun/@webext-core+match-patterns@2.0.0/node_modules/@webext-core/match-patterns/dist/index.d.mts:28
isHttpMatch
privateisHttpMatch:any
Source
node_modules/.bun/@webext-core+match-patterns@2.0.0/node_modules/@webext-core/match-patterns/dist/index.d.mts:26
isHttpsMatch
privateisHttpsMatch:any
Source
node_modules/.bun/@webext-core+match-patterns@2.0.0/node_modules/@webext-core/match-patterns/dist/index.d.mts:27
isPathMatch
privateisPathMatch:any
Source
node_modules/.bun/@webext-core+match-patterns@2.0.0/node_modules/@webext-core/match-patterns/dist/index.d.mts:30
isUnknownProtocol
privateisUnknownProtocol:any
Source
node_modules/.bun/@webext-core+match-patterns@2.0.0/node_modules/@webext-core/match-patterns/dist/index.d.mts:29
isUrnMatch
privateisUrnMatch:any
Source
node_modules/.bun/@webext-core+match-patterns@2.0.0/node_modules/@webext-core/match-patterns/dist/index.d.mts:33
pathnameMatch
privatepathnameMatch:any
Source
node_modules/.bun/@webext-core+match-patterns@2.0.0/node_modules/@webext-core/match-patterns/dist/index.d.mts:15
protocolMatches
privateprotocolMatches:any
Source
node_modules/.bun/@webext-core+match-patterns@2.0.0/node_modules/@webext-core/match-patterns/dist/index.d.mts:13
PROTOCOLS
staticPROTOCOLS:string[]
Source
node_modules/.bun/@webext-core+match-patterns@2.0.0/node_modules/@webext-core/match-patterns/dist/index.d.mts:12
Methods
includes()
includes(
url):boolean
Check if a URL is included in a pattern.
Parameters
▪ url: string | URL | Location
Source
node_modules/.bun/@webext-core+match-patterns@2.0.0/node_modules/@webext-core/match-patterns/dist/index.d.mts:25
Generated using typedoc-plugin-markdown and TypeDoc