Bug 273069 - Content Scripts do not match on the URL query
Summary: Content Scripts do not match on the URL query
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Extensions (show other bugs)
Version: Safari 17
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2024-04-22 08:44 PDT by Carlos J.
Modified: 2024-05-23 23:18 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos J. 2024-04-22 08:44:56 PDT
Safari incorrectly ignores the query string when matching match patterns. Giving the following match pattern:
"https://example.com/*query*"

Safari matches only when the "query" is part of the pathname, not the query string.

It should also match the following URL:
https://example.com/?query=1

Example extension:
https://github.com/carlosjeurissen/webext-tech-demo-extensions/tree/main/issues/safari-content-script-query-match
Comment 1 Carlos J. 2024-04-23 05:23:40 PDT
This has been tested in Safari 17 and Safari Technology Preview 192. In both no match is made on the URL query.
Comment 2 Timothy Hatcher 2024-05-23 10:27:36 PDT
Carlos, do you know if this is a regression from previous behavior or has Safari always behaved this way?
Comment 3 Radar WebKit Bug Importer 2024-05-23 10:27:49 PDT
<rdar://problem/128621567>
Comment 4 Carlos J. 2024-05-23 23:18:35 PDT
Thanks for looking into this! I can not rule out this used to work at some point in the past.