mdn / content

The content behind MDN Web Docs
https://developer.mozilla.org
Other
9.15k stars 22.46k forks source link

Issue with "Match patterns in extension manifests": "fragment identifiers" - examples are missing for matching URLs that use "fragment identifiers" #14018

Open chrimez opened 2 years ago

chrimez commented 2 years ago

MDN URL: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Match_patterns

What information was incorrect, unhelpful, or incomplete?

Page says: "Neither the URL fragment identifier, nor the # which precedes it, are considered as part of the path." Unclear what it means:

  1. it's not considered to be part of "path" in match clause. Hence its presence would be IGNORED when included in the URL string (or search strin?)
  2. unclear whether fragment identifiers are considered part of the URL path string, or URL query string.

Specific section or headline?

"Neither the URL fragment identifier, nor the # which precedes it, are considered as part of the path."

What did you expect to see?

I expect 1 or 2 more examples of how to match an URL that uses fragment identifiers. E.g. how to match: https://mozilla.org/*/b/*/something#part1

Did you test this? If so, how?

With my own add-on, I was not able to match the URL: https://mypage.com/a/b/number/something#part1

Following did NOT match it: https://mypage.com/a/b/*/something#part1 https://mypage.com/a/b/*/something https://mypage.com/a/b/*/something https://mypage.com/a/b//something#*

MDN Content page report details * Folder: `en-us/mozilla/add-ons/webextensions/match_patterns` * MDN URL: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Match_patterns * GitHub URL: https://github.com/mdn/content/blob/main/files/en-us/mozilla/add-ons/webextensions/match_patterns/index.md * Last commit: https://github.com/mdn/content/commit/0160aac0e623dacdce4019205f32f7b3d3e58019 * Document last modified: 2022-02-18T09:33:58.000Z
chrimez commented 2 years ago

seems my input has not been of much help... I'm wondering what's missing to improve its impact.

Rob--W commented 1 week ago

What it means that for matching purposes, the reference fragment of a given URL are ignored.

One should not specify a # in a match pattern either: because the reference fragment is ignored, a match pattern containing # will not match any URL.