Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@webext-core/match-patterns

aklinker1124.7kMIT1.0.3TypeScript support: included

Utilities for working with match patterns.

web-extension, browser-extension, chrome-extension, webext, web-ext, chrome, firefox, safari, browser, extension, match, pattern, content, script

readme

@webext-core/match-patterns

Utilities for working with match patterns.

pnpm i @webext-core/match-patterns
import { MatchPattern } from '@webext-core/match-patterns';

const pattern = MatchPattern('*://*.google.com/*');

pattern.includes('http://google.com/search?q=test'); // true
pattern.includes('https://accounts.google.com'); // true
pattern.includes('https://youtube.com/watch'); // false

Get Started

See documentation to get started!

Supported Protocols

Not all protocols are supported. Open a PR to add support.

  • <input checked="" disabled="" type="checkbox"> <all_urls>
  • <input checked="" disabled="" type="checkbox"> https protocol
  • <input checked="" disabled="" type="checkbox"> http protocol
  • <input disabled="" type="checkbox"> file protocol
  • <input disabled="" type="checkbox"> ftp protocol
  • <input disabled="" type="checkbox"> urn protocol