Skip to content

Match Rules In Depth ​

Four directives decide where the app runs. Evaluation order: @match defines the base scope, @include narrows it, then @exclude / @exclude-match carve out exceptions. That is:

hit = hits any @match and (no @include declared or hits any @include) and hits no @exclude / @exclude-match

Enabled apps, hot injection and liveDebug tab selection all evaluate this same rule. Note that this differs from Tampermonkey, where @include adds pages: here @include only ever shrinks the scope — add another @match to cover more pages.

// @match background is a reserved word, not a URL rule: it never participates in page-match evaluation (recognized case-insensitively, quotes tolerated) — it only switches the app's execution target to the background sandbox (see "Execution target: background"). Only the remaining URL-style @match entries enter the evaluation above; a pure background app (reserved word only) has no page-injection branch, so the "<all_urls> when no @match" fallback does not apply to it either. @include / @exclude / @exclude-match constrain the page branch only and have no effect on the background branch.

Match patterns (@match / @exclude-match) ​

The format is <scheme>://<host>/<path>, and * is only legal in specific positions:

PatternMeaning
https://*.commerce.com/*Every https page on any commerce.com subdomain
*://seller.seller-platform.com/*http and https pages on that host
<all_urls>All pages (the default when no @match is declared)

Common mistakes: the host * may only stand alone or be the leftmost prefix (*.commerce.com is valid, commerce.* / *commerce.com are not); the path must start with / (https://commerce.com lacks a path — write https://commerce.com/*); the scheme must be lowercase * / http / https / file / ftp. Invalid patterns fail the compile with the reason.

Globs (@include / @exclude) ​

Plain wildcard syntax — * matches any character sequence and ? a single character, anywhere, e.g. *://*.commerce.com/bg* or *login*. A glob is compared against the whole URL (scheme and query included), case-insensitively, so path-keyword filters usually need * on both ends.

Debugging ​

  • The "Match rules" column in the app list aggregates all four directives; hover to see every rule
  • If injection does not happen, check four things first: is the app enabled, does the URL hit @match, does it hit @include (when declared), is it excluded
  • liveDebug targets tabs using the exact same rule evaluation