Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Match pattern fragment clarification #36069

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

rebloor
Copy link
Contributor

@rebloor rebloor commented Sep 27, 2024

Description

Clarifies how fragments are handled in response to #14018

Related issues and pull requests

Fixes #14018

@rebloor rebloor added the Content:WebExt WebExtensions docs label Sep 27, 2024
@rebloor rebloor requested a review from Rob--W September 27, 2024 04:25
@rebloor rebloor self-assigned this Sep 27, 2024
@rebloor rebloor requested a review from a team as a code owner September 27, 2024 04:25
@github-actions github-actions bot added the size/s [PR only] 6-50 LoC changed label Sep 27, 2024
Copy link
Contributor

github-actions bot commented Sep 27, 2024

Preview URLs

External URLs (1)

URL: /en-US/docs/Mozilla/Add-ons/WebExtensions/Match_patterns
Title: Match patterns

(comment last updated: 2024-11-17 22:47:01)

@rebloor rebloor requested a review from dotproto October 10, 2024 22:41
@rebloor
Copy link
Contributor Author

rebloor commented Nov 15, 2024

@Rob--W @dotproto reminder that I'm looking for a review on this one

@@ -342,6 +342,10 @@ The special value `<all_urls>` matches all URLs under any of the supported schem
<td><code>https://mozilla.org</code></td>
<td>No path.</td>
</tr>
<tr>
<td><code>https://mozilla.org/#section1</code></td>
<td>Contains an unsupported match character.</td>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a syntactically invalid match pattern, just one that never matches.

The other examples here are examples of match patterns that are rejected as a value for "match pattern" types, but this one is accepted.

On the other hand, the example below with a host name is also syntactically valid but listed as invalid. In Chrome it is valid but in Firefox it is ignored.

@@ -342,6 +342,10 @@ The special value `<all_urls>` matches all URLs under any of the supported schem
<td><code>https://mozilla.org</code></td>
<td>No path.</td>
</tr>
<tr>
<td><code>https://mozilla.org/#section1</code></td>
<td>Contains an unsupported match character.</td>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<td>Contains an unsupported match character.</td>
<td>Contains a reference fragment, which are never included in the URLs to match against.</td>

Can probably be phrased better than this. It is not that the character is unsupported technically, but that the URL that the pattern is matched against never includes the reference fragment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Rob--W made some changes to address, let me know what you think

@rebloor rebloor requested a review from Rob--W November 17, 2024 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:WebExt WebExtensions docs size/s [PR only] 6-50 LoC changed
Projects
None yet
2 participants