pixiebrix-extension icon indicating copy to clipboard operation
pixiebrix-extension copied to clipboard

Update the "All URLs" site shortcut to insert `<all_urls>`

Open twschiller opened this issue 1 year ago • 1 comments

Context

  • *://* only matches http/https URLs
  • Some iframes use srcdoc so have a about:srcdoc URL
  • <all_urls> is a special match pattern to match any URL with a permitted scheme https://developer.chrome.com/docs/extensions/develop/concepts/match-patterns. For the purposes of running mods, we treat it as matching about:srcdoc: https://github.com/pixiebrix/pixiebrix-extension/blob/733719b0a8f55f9f3160b0279b09a103714edc36/src/bricks/available.ts#L25-L25
  • Chrome's contextMenu API also supports <all_urls> for documentUrlPatterns
  • By and large, all of our uses of *://* that aren't for sidebar should actually be <all_urls> (e.g., context menu, snippets, etc.). It's safe to have the site pattern be that for sidebars too though

Discussion

  • Are there some site/permissions contexts where <all_urls> is not a valid value?
  • Ideally, end users should not have to think about the distinction between <all_urls> and *://*

twschiller avatar Apr 05 '24 17:04 twschiller