Skip to content

API > wxt/sandbox > MatchPattern

Class: MatchPattern

Class for parsing and performing operations on match patterns.

Contents

Example

ts
const pattern = new MatchPattern("*://google.com/*");

pattern.includes("https://google.com");            // true
pattern.includes("http://youtube.com/watch?v=123") // false

Constructors

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

convertPatternToRegex

private convertPatternToRegex: any

Source

node_modules/.pnpm/@webext-core+match-patterns@1.0.3/node_modules/@webext-core/match-patterns/lib/index.d.ts:33


escapeForRegex

private escapeForRegex: any

Source

node_modules/.pnpm/@webext-core+match-patterns@1.0.3/node_modules/@webext-core/match-patterns/lib/index.d.ts:34


hostnameMatch

private hostnameMatch: any

Source

node_modules/.pnpm/@webext-core+match-patterns@1.0.3/node_modules/@webext-core/match-patterns/lib/index.d.ts:13


isAllUrls

private isAllUrls?: any

Source

node_modules/.pnpm/@webext-core+match-patterns@1.0.3/node_modules/@webext-core/match-patterns/lib/index.d.ts:15


isFileMatch

private isFileMatch: any

Source

node_modules/.pnpm/@webext-core+match-patterns@1.0.3/node_modules/@webext-core/match-patterns/lib/index.d.ts:30


isFtpMatch

private isFtpMatch: any

Source

node_modules/.pnpm/@webext-core+match-patterns@1.0.3/node_modules/@webext-core/match-patterns/lib/index.d.ts:31


isHostPathMatch

private isHostPathMatch: any

Source

node_modules/.pnpm/@webext-core+match-patterns@1.0.3/node_modules/@webext-core/match-patterns/lib/index.d.ts:29


isHttpMatch

private isHttpMatch: any

Source

node_modules/.pnpm/@webext-core+match-patterns@1.0.3/node_modules/@webext-core/match-patterns/lib/index.d.ts:27


isHttpsMatch

private isHttpsMatch: any

Source

node_modules/.pnpm/@webext-core+match-patterns@1.0.3/node_modules/@webext-core/match-patterns/lib/index.d.ts:28


isUrnMatch

private isUrnMatch: any

Source

node_modules/.pnpm/@webext-core+match-patterns@1.0.3/node_modules/@webext-core/match-patterns/lib/index.d.ts:32


pathnameMatch

private pathnameMatch: any

Source

node_modules/.pnpm/@webext-core+match-patterns@1.0.3/node_modules/@webext-core/match-patterns/lib/index.d.ts:14


protocolMatches

private protocolMatches: any

Source

node_modules/.pnpm/@webext-core+match-patterns@1.0.3/node_modules/@webext-core/match-patterns/lib/index.d.ts:12


PROTOCOLS

static PROTOCOLS: 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