Closed Bug 1715366 Opened 3 years ago Closed 2 years ago

For "Network.requestWillBeSent" a possible URL hash needs to be included in "request.urlFragment" and not "request.url"

Categories

(Remote Protocol :: CDP, defect, P3)

Firefox 89
defect

Tracking

(firefox104 fixed)

RESOLVED FIXED
104 Branch
Tracking Status
firefox104 --- fixed

People

(Reporter: z, Assigned: whimboo)

References

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:89.0) Gecko/20100101 Firefox/89.0

Steps to reproduce:

  1. Connect to the Remote Protocol and run Network.enable.
  2. Load a document in an iframe with a hash URL, like http://localhost:43029/hash.html#foo.

Actual results:

The ensuing Network.requestWillBeSent event will have a request.url property of http://localhost:43029/hash.html#foo.

Expected results:

The ensuing Network.requestWillBeSent event should have a request.url property of ``http://localhost:43029/hash.html`, and #foo in the `request.urlFragment` property.

The CDP description for Network.request.url:

Request URL (without fragment).

The Bugbug bot thinks this bug should belong to the 'DevTools::Netmonitor' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → Netmonitor
Product: Firefox → DevTools
Blocks: 1549509
Component: Netmonitor → CDP
Product: DevTools → Remote Protocol

Thanks Zach for reporting. It should actually be a simple change that needs to be done here:
https://searchfox.org/mozilla-central/rev/79d73b4aff88dd4a0f06dd3789e1148c49b0de60/remote/cdp/domains/parent/Network.jsm#386-387

When doing that adding a test would be great too.

Zach, how important is that for your use cases?

Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(z)
Summary: Network.requestWillBeSent `url` field should not include hash → For "Network.requestWillBeSent" a possible URL hash needs to be included in "request.urlFragment" and not "request.url"

The importance is low because we can easily work around it (if (url.includes('#')) url = url.slice(0, url.indexOf('#'))), but it would be nice to not have to do that. So it's a "nice to have" for Cypress.

This is being used for Cypress's new/upcoming HTTP features - we are using Network.requestWillBeSent to correlate metadata that only the browser knows about requests (initiator, resource type, etc) with the actual HTTP requests that come through our proxy, which unlocks some new functionality that is handy for testing. PR if you're curious: https://github.com/cypress-io/cypress/pull/16835

Flags: needinfo?(z)
  • Removed the fragment identifier from request.url
  • Sets request.urlFragment to the #fragmentIdentifier
Assignee: nobody → z
Status: NEW → ASSIGNED

Hi Zach, I have seen that you attached a patch and I also gave some comments on the patch. Will you have the time to apply those? It would be great to see this bug fixed. Thanks!

Flags: needinfo?(z)

Hey, I will return to the patch shortly, I was just away from the PC for a couple of weeks. I am getting back into the swing of things, still plan on finishing this. Thanks for the comments!

Flags: needinfo?(z)

Sounds good. Thanks Zach!

Severity: -- → S3
Priority: -- → P3

Hi Zach, I wonder if someone else could pick it up and finish in case you don't have the time for the remaining work. Just let us know. Thanks.

Flags: needinfo?(z)

The bug assignee didn't login in Bugzilla in the last 7 months.
:whimboo, could you have a look please?
For more information, please visit auto_nag documentation.

Assignee: z → nobody
Status: ASSIGNED → NEW
Flags: needinfo?(hskupin)

Not a priority right now and we can check when it's needed.

Flags: needinfo?(hskupin)

Redirect a needinfo that is pending on an inactive user to the triage owner.
:whimboo, could you please find another way to get the information or close the bug as INCOMPLETE if it is not actionable?

For more information, please visit auto_nag documentation.

Flags: needinfo?(z) → needinfo?(hskupin)

Because of the WiP state of the attached patch I didn't see the reply from Zach, and a follow-up on the bug directly never happened. I'll take a look later today.

Assignee: nobody → z
Status: NEW → ASSIGNED
Attachment #9226586 - Attachment description: WIP: Bug 1715366 - Fix fragment handling in Network.requestWillBeSent → WIP: Bug 1715366 - [cdp] Fix fragment handling in Network.requestWillBeSent.
Attachment #9226586 - Attachment description: WIP: Bug 1715366 - [cdp] Fix fragment handling in Network.requestWillBeSent. → Bug 1715366 - [cdp] Fix fragment handling in Network.requestWillBeSent.

The bug assignee is inactive on Bugzilla, so the assignee is being reset.

Assignee: z → nobody
Status: ASSIGNED → NEW
Assignee: nobody → hskupin
Status: NEW → ASSIGNED
Attachment #9226586 - Attachment description: Bug 1715366 - [cdp] Fix fragment handling in Network.requestWillBeSent. → Bug 1715366 - [CDP] Fix URL fragment handling in Network.requestWillBeSent.
Pushed by hskupin@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b363ae1f1a6d
[CDP] Fix URL fragment handling in Network.requestWillBeSent. r=webdriver-reviewers,jdescottes
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 104 Branch
Flags: needinfo?(hskupin)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: