API > wxt/sandbox > 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/.pnpm/@webext-core+match-patterns@1.0.3/node_modules/@webext-core/match-patterns/lib/index.d.ts:22
Properties
PROTOCOLS
staticPROTOCOLS:string[]
Source
node_modules/.pnpm/@webext-core+match-patterns@1.0.3/node_modules/@webext-core/match-patterns/lib/index.d.ts:11
Methods
includes()
includes(
url):boolean
Check if a URL is included in a pattern.
Parameters
▪ url: string | URL | Location
Source
node_modules/.pnpm/@webext-core+match-patterns@1.0.3/node_modules/@webext-core/match-patterns/lib/index.d.ts:26
Generated using typedoc-plugin-markdown and TypeDoc