Inconsistent behaviour of Match Pattern with Port
Categories
(WebExtensions :: Untriaged, defect)
Tracking
(Not tracked)
People
(Reporter: eros_uk, Unassigned)
Details
User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0
Steps to reproduce:
Generally, Match Pattern errors result in error and throw.
MDN states "host must not include a port number."
While testing, it appears that having PORT in HOST does not throw or create an error.
It was originally brought up while testing contentScripts.register
.
(ref: https://github.com/erosman/support/issues/187 )
However, similar result is observed when adding PORT to "content_scripts"
in manifest.json
Test case:
https://github.com/mdn/webextensions-examples/tree/master/borderify
Change:
"matches": ["://.mozilla.org/*"],
To:
"matches": ["://.mozilla.org:1234/*"],
Actual results:
No error is generated and extension installs fine. Although it does not add a border to mozilla.org
.
I do not have access to a test server to see if the PORT is actually applied i.e. what happens if one goes to the https://www.mozilla.org:1234/
Expected results:
Based on MDN, since other Match Pattern errors generate a throw error, including PORT should also behave the same way.
Example of Match Pattern Error when applied to manifest.json
:
"matches": ["*://*mozilla.org/*"],
Result:
Error details Protocol error (unknownError): Extension is invalid from: server0.conn9.webExtensionDescriptor225
Example of Match Pattern Error when applied to contentScripts.register
or userScripts.register
Type error for parameter userScriptOptions (Error processing matches.27: Value "*://*.example*.com/*" must either: be one of ["<all_urls>"], must either [match the pattern /^(https?|wss?|file|ftp|\*):\/\/(\*|\*\.[^*/]+|[^*/]+)\/.*$/, or match the pattern /^file:\/\/\/.*$/], or match the pattern /^resource:\/\/(\*|\*\.[^*/]+|[^*/]+)\/.*$|^about:/) for userScripts.register.
Comment 1•4 years ago
|
||
Bugbug thinks this bug should belong to this component, but please revert this change in case of error.
Updated•4 years ago
|
Description
•