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

Issue with "Match patterns in extension manifests": (invalid match patterns should include example with port number) #5718

Closed
ManfredLange opened this issue Jun 6, 2021 · 5 comments
Assignees
Labels
Content:WebExt WebExtensions docs good first issue A good issue for newcomers to get started with. p4 A minor issue on a Tier 2 MDN doc.

Comments

@ManfredLange
Copy link

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

What information was incorrect, unhelpful, or incomplete?

The host section specifically states that host must not include a port number but that is easily overlooked.

Specific section or headline?

host section and Invalid Match Patterns section

What did you expect to see?

The Invalid Match Pattern should include an example of a host with a port number to show that it will not work as expected.

Did you test this? If so, how?

Precondition for both tests: a web server is running on localhost at port 2502.

Test 1:

The following in manifest.json will lead to CORS error:

   "permissions": [
      "*://localhost:2502/*",
   ],

Test 2:

The following in manifest.json will work (note the absence of the port number):

   "permissions": [
      "*://localhost/*"
   ],

These tests were conducted on Firefox version 89.0 (64-bit) running on Windows 10 Pro, version 10.0.19042 build 19042.

MDN Content page report details
@ManfredLange ManfredLange changed the title Issue with "Match patterns in extension manifests": (short summary here please) Issue with "Match patterns in extension manifests": (invalid match patterns should include example with port number) Jun 6, 2021
@sideshowbarker sideshowbarker added Content:WebExt WebExtensions docs needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. labels Jun 6, 2021
@Rob--W Rob--W removed the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Jun 10, 2021
@Rob--W Rob--W self-assigned this Jun 10, 2021
@Rob--W
Copy link
Member

Rob--W commented Jun 10, 2021

We will resolve this issue by changing Firefox to support permissions with ports in it - https://bugzilla.mozilla.org/show_bug.cgi?id=1350523

More details at https://bugzilla.mozilla.org/show_bug.cgi?id=1350523#c5

@sideshowbarker
Copy link
Collaborator

@Rob--W Should we add a note to the MDN article in the meantime? Or should be instead just keep this open until the change is made in the sources and that BMO bug is resolved?

@Rob--W
Copy link
Member

Rob--W commented Jun 10, 2021

This is already documented. The issue is about adding an extra example, but that's not necessary if we fix the issue in Firefox.

@ManfredLange
Copy link
Author

I disagree. The documentation states that you must not use a port number. That is easy to overlook. Remember there is a lot of text in that page. Adding a row to the list of invalid examples would have save me a lot of time (a couple of hours?).

Even once fixed, the example should be either in the list of valid/invalid along with version information. If Firefox is changed so it considers (or at least ignores) port numbers as well, I think the documentation including the examples should be updated including which rule applies to which version of Firefox.

Just my two cents being a consumer of both the API as well as the documentation.

@rebloor rebloor added good first issue A good issue for newcomers to get started with. p4 A minor issue on a Tier 2 MDN doc. labels Aug 4, 2021
@rebloor
Copy link
Contributor

rebloor commented Aug 24, 2023

Page includes the invalid example

https://mozilla.org:80/ Host must not include a port number.

@rebloor rebloor closed this as completed Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:WebExt WebExtensions docs good first issue A good issue for newcomers to get started with. p4 A minor issue on a Tier 2 MDN doc.
Projects
Status: Done
Development

No branches or pull requests

5 participants